Hi Folks,
I'm getting strange behavior with custom validation controls -
They all stopped working!
The Validation Controls do their job...by making args.isValid to False..
but for some reason Page.isValid remains always true...so in fact it is as though the validators had no effect on the page...
What can be causing this?
This is an example of a validator I have on the page with the resulting trace out:
Validation Event:
Protected Sub CustomValEClaim_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
' Trace that event is firring
Trace.Warn("CustomVal Happening")
' Trace Values which Validator must compare
Trace.Warn("Max " + Session("MaxVal").ToString)
Trace.Warn("Current " + CurrentVal.Text)
' Evaluate True or False
If CInt(CurrentVal.Text) < Session("MaxVal") Then
args.IsValid = True
'
Trace.Warn("Args Should be True")
Trace.Warn("args.isValid:" + args.IsValid.ToString)
Trace.Warn("page.isValid: " + Page.IsValid.ToString)
Else
args.IsValid = False
args.IsValid = False
Trace.Warn("Should be False")
Trace.Warn("args.isValid:" + args.IsValid.ToString)
Trace.Warn("page.isValid: " + Page.IsValid.ToString)
End If
End Sub
TraceOut
CustomVal Happening
Max 10
Current 12
Should be False
args.isValid:False
page.isValid: True < --- Why is this True..when args.isValid is False?!
Regards,
- Joel
I'm getting strange behavior with custom validation controls -
They all stopped working!
The Validation Controls do their job...by making args.isValid to False..
but for some reason Page.isValid remains always true...so in fact it is as though the validators had no effect on the page...
What can be causing this?
This is an example of a validator I have on the page with the resulting trace out:
Validation Event:
Protected Sub CustomValEClaim_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
' Trace that event is firring
Trace.Warn("CustomVal Happening")
' Trace Values which Validator must compare
Trace.Warn("Max " + Session("MaxVal").ToString)
Trace.Warn("Current " + CurrentVal.Text)
' Evaluate True or False
If CInt(CurrentVal.Text) < Session("MaxVal") Then
args.IsValid = True
'
Trace.Warn("Args Should be True")
Trace.Warn("args.isValid:" + args.IsValid.ToString)
Trace.Warn("page.isValid: " + Page.IsValid.ToString)
Else
args.IsValid = False
args.IsValid = False
Trace.Warn("Should be False")
Trace.Warn("args.isValid:" + args.IsValid.ToString)
Trace.Warn("page.isValid: " + Page.IsValid.ToString)
End If
End Sub
TraceOut
CustomVal Happening
Max 10
Current 12
Should be False
args.isValid:False
page.isValid: True < --- Why is this True..when args.isValid is False?!
Regards,
- Joel