I have a serious problem. When i change the language of my ressource manager. My defaut assembly file is language.resx and it containt french traduction. When I change for use my language.en.resx file, all my Validators are disable and my form isn't protected
!!
After one day of research I haven't found the source of this problem... Does someone can help me ?
Instruction for change my assembly langugae culture :
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en")
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.
You also *must* test Page.IsValid is true before saving in the Click event method. Otherwise, all browsers without client-side validation support will bypass your validation. This includes Mozilla, FireFox, Safari, and even IE with javascript disabled.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
My page is a Mobile Web form, so there are not javascript client side validators. My problem is that all my server side validators aren't executed ( request field validator are allways true, and the custom validator method isn't called). So when I test Page.Isvalid
in my Bouton method, this value is allways true...
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.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
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...
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.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
I have found my error, that was the wap navigator that doesn't return the button value of the form and I used it to switch visible my panel. Now, I set my visible parametter directly in my click method and that's good :).
None
0 Points
17 Posts
Validators disable !
May 12, 2005 09:53 AM|alexite|LINK
I have a serious problem. When i change the language of my ressource manager. My defaut assembly file is language.resx and it containt french traduction. When I change for use my language.en.resx file, all my Validators are disable and my form isn't protected !!
After one day of research I haven't found the source of this problem... Does someone can help me ?
Instruction for change my assembly langugae culture :
Thread.CurrentThread.CurrentUICulture = New CultureInfo("en")
Star
7962 Points
5325 Posts
Re: Validators disable !
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.
You also *must* test Page.IsValid is true before saving in the Click event method. Otherwise, all browsers without client-side validation support will bypass your validation. This includes Mozilla, FireFox, Safari, and even IE with javascript disabled.
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
None
0 Points
17 Posts
Re: Validators disable !
May 16, 2005 03:48 AM|alexite|LINK
Firstly, thanks for you answer.
My page is a Mobile Web form, so there are not javascript client side validators. My problem is that all my server side validators aren't executed ( request field validator are allways true, and the custom validator method isn't called). So when I test Page.Isvalid in my Bouton method, this value is allways true...
Star
7962 Points
5325 Posts
Re: Validators disable !
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.
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
None
0 Points
17 Posts
Re: Validators disable !
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
Star
7962 Points
5325 Posts
Re: Validators disable !
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.
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
None
0 Points
17 Posts
Re: Validators disable !
May 25, 2005 09:42 AM|alexite|LINK
I have found my error, that was the wap navigator that doesn't return the button value of the form and I used it to switch visible my panel. Now, I set my visible parametter directly in my click method and that's good :).