Content

Validators Not Submitting on an ASP.NET Form

9 Jan

+ 1

WOW! I have been having this problem where my submit buttons would just stop posting back for no reason. It seemed that some pages would work, and some didn’t. I just didn’t know enough to even know where to look.

Thank goodness for Scott Mitchell. He wrote up the reason for it here:

http://scottonwriting.net/sowblog/posts/2943.aspx

To digest it quickly, if you have applied the ASP.NET Hotifix to your computer, you could be having this problem. Look in your WebUIValidation.js file. The function in question should look like this:


function ValidatorCommonOnSubmit() {
    var result = !Page_BlockSubmit;
    Page_BlockSubmit = false;
    event.returnValue = result;
    return result;
}

If it looks like this:


function ValidatorCommonOnSubmit() {
    event.returnValue = !Page_BlockSubmit;
    Page_BlockSubmit = false;
}

you are gonna have a problem. Change it to the one above.

The reason I didnt spot this is for one, I use Peter Blum’s Controls which don’t have this problem, and only one of my websites had the incorrect function. Go figure.

Thank you so much, god bless you.

Comment

#

I reserve the right to delete and / or modify the comments that contain inappropriate language, spam or other behavior not appropriate in a civilized community. If your comment does not appear, it may be that akismet caught it.