Last post May 25, 2005 09:42 AM by alexite
May 12, 2005 09:53 AM|alexite|LINK
May 13, 2005 10:53 AM|PLBlum|LINK
It sounds like the WebUIValidation.js file isn't loading. View the HTML source to confirm its <script> tag is present and attempt to open the file from the browser using its URL and the web site's domain.
May 16, 2005 03:48 AM|alexite|LINK
Firstly, thanks for you answer.
in my Bouton method, this value is allways true...
May 16, 2005 11:51 AM|PLBlum|LINK
Confirm that your submit button's CausesValidation property is true. When its false, it does not automatically call Page.Validate(), which runs validation.
Confirm that your validators are Enabled=true
If you are using ASP.NET 2.0, confirm that the validation group on the submit button matches the group on each validator.
May 23, 2005 03:55 AM|alexite|LINK
I don't find the enabled parameter of my validators but all of them are visible. If in my OnClick method of my button I call the Page.Validate() method, this one do nothing and my Page.Validate parametter is allways True.
The validators are executed with some phone users agent, and not for some others...
PS: I'm using ASP.Net 1.1
May 23, 2005 12:50 PM|PLBlum|LINK
I don't have a definitive answer. I understand how ASP.NET works here so I'll review the facts with you in case it reveals something to you.
Page.Validate() goes through the Page.Validators list. If the validator control is Enabled, the method Validate() is called on it. That internally sets the IsValid property on the Validator control to either true or false. If any control is found to be IsValid=false,
Page.IsValid is set to false.
The validator's Validate() method calls an internal "evaluation method" where all the logic is. For example, the RequiredFieldValidator will retrieve the text value from the ControlToValidate property and compare it to the InitialValue property. If the text
value is not equal to InitialValue, it returns an indication that its valid.
Some things can go wrong but they are usually server side problems. For example, you set EnableViewState=false and only set ControlToValidate the first time. On post back, ControlToValidate is "". Another case is that the data isn't being passed back. So
the TextBox.Text property does not have the data you think. (This is the only thing that I can connect to a specific platform.) My recommendation is to write some debug code in the Click post back event that confirms all of the properties used to evaluate
(ControlToValidate, ValueToCompare, Operator, Type, etc.). Debug the value of the textbox to confirm is right. Then call Validate() on the validator itself and test the validator's IsValid property.
May 25, 2005 09:42 AM|alexite|LINK