Asp.net Validators not Firing

asp.netclient-sidevalidation

I am doing some work on a legacy project, one that has been upgraded through the years from 1.1, to 2.0, and is now set at 3.5. Currently I am having some issues with required field validators not running when I click submit.

It's a pretty simple setup. I have two textboxes, I need both to be filled when a user clicks submit, I have RFV's pointing to each textbox but when I click the submit button the validation is not fired and then the resulting code bombs out. I have tried using both ValidationGroup on the relevant controls and also changing Display from "Dynamic" to "Static", with no results.

I've also had some issues when using AJAX controls where I get javascript errors and the like, which to me would point to an incorrect config regarding client-side libraries. Of course, I'm not really sure how to go about pinpointing the errors in my config. Any suggestions?

Thanks,

Mike

Best Answer

As for the specific error, I am not sure, but I would caution you to modify your code to ensure that you do not have problems on the server side.

Add a check in your method to ensure that the validators are valid.

if(Page.IsValid)
{
    //Now do your thing
}
Related Topic