Asp net requiredfieldvalidator not validating
NET validation controls provide functionality to perform validation using client script.
By default, when client-side validation is being performed, the user cannot post the page to the server if there are errors on the page thus the user experience with the page is enhanced.
Anyway, once I found this I spent another hour or so googling and testing before I finally remembered I had just implemented Routing the other day, added the ignore exception mentioned above and – bingo it was working again.
🙂 In a way something good came out of this because, when client side validation fails it will rely only on server side validation and that means another thing you should never forget – to always add at the top of your button click event: I had forgot this, which meant that when my client side field validation – which I had relied on in the past – did not work, my script just kept going even though the fields did not validate.
I noticed that the , is getting prefixed after the menu is completly loaded along with the submenus.
Initially when the page is loaded and the sub menus are not loaded yet, the login is working fine and no , is prefixed.
The solution is a common code for many clients and can not be changed.
This was an old Web Site project that I had not touched in over a year. NET 2.0 to 4.0, upgraded the Visual Studio solution from VS2008 to VS2010, made a lot of functionality and programming changes and only today discovered that Field Validation was not working anymore 🙁 I tried to trace my steps but I had just made too many changes to figure out just what was causing this. I made the simplest pages with a single Required Field Validator.
Finally I used the Chrome built-in Developer Tool and saw a few lines like this: /Web Resource.axd?
Page_Validators Array of elements This is an array containing all of the validators on the page.
Page_Validation Active Boolean variable Indicates whether validation should take place.
Set this variable to False to turn off validation programmatically.isvalid Boolean property This is a property on each client validator indicating whether it is currently valid.