Validation Controls not working on Firefox

The ASP.Net validations controls only work client side in IE.

You can make them work in other browsers, coding as below:

C#

Page.Validate();

if ( !Page.IsValid )
{
return;
}
//Continue Your code

VB.NET

Page.Validate()

If Not Page.IsValid Then
Return
End If

'Continue Your code

Refer Scott Mitchells' article Client Side Validations in Downlevel browsers for more details.

Other Third Party Solutions avaiable are :

 

9 Comments

  • Calling if(Page.IsValid) inheriently calls Page.Validate if it has not been called previously. So, there's really no point in calling it.

  • if you do some searches there is a nice set of things you can do.



    the "Browser Caps" need to be updated to tell asp.net to handle firefox and some other new browsers as "Up Level"



    this then allows for FireFox to get the same HTML and JavaScript that IE 6 gets.



    there are some sample files out there you can download that show you what files to edit and what to add.

  • Yup denny - the only problem is that you have to modify the machine.config, so in hosted environments, that doesn't work so great.

  • Note that the validation controls do work uplevel in FireFox with ASP.NET 2.0 automatically.

  • Thank you for this point.

    I hate dislike Firefox and think Maxthon is better :D

  • The bug is in ASP.NET, not Firefox. ASP.NET incorrectly identifies Firefox as a downlevel browser.

  • Hey, I have been facing a strange problem, I have both .Net 1.1 as well as 2.0 installed on my machine as a result none of the .Net validators seems to be working on my machine. Not even the solution that has been provided in the blog works for me.
    In fact the following method:

    Page.Validate()
    If Not Page.IsValid Then
    Return

    which seems to be working pn all machines doesnt work on mine.
    Does any one have a solution to the said problem?
    End If

  • Can any one tell me about the problem

  • But where can I put this c# code which in starting on this blog....

Comments have been disabled for this content.