0 Replies - 2430 Views - Last Post: 03 December 2008 - 10:48 PM Rate Topic: -----

#1 PolkaDotNet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-December 08

Why is "Page.IsValid = True' even when "args.IsValid = F

Post icon  Posted 03 December 2008 - 10:48 PM

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

Is This A Good Question/Topic? 0
  • +

Page 1 of 1