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 :

 

Published Friday, March 25, 2005 3:02 PM by SushilaSB
Filed under:

Comments

Friday, March 25, 2005 3:57 PM by Matt Hawley

# re: Validation Controls not working on Firefox

Calling if(Page.IsValid) inheriently calls Page.Validate if it has not been called previously. So, there's really no point in calling it.
Friday, March 25, 2005 4:14 PM by denny

# re: Validation Controls not working on Firefox

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.
Friday, March 25, 2005 4:41 PM by Matt Hawley

# re: Validation Controls not working on Firefox

Yup denny - the only problem is that you have to modify the machine.config, so in hosted environments, that doesn't work so great.
Friday, March 25, 2005 6:48 PM by scottgu

# re: Validation Controls not working on Firefox

Note that the validation controls do work uplevel in FireFox with ASP.NET 2.0 automatically.
Friday, March 25, 2005 8:20 PM by Jon Galloway

# re: Validation Controls not working on Firefox

The change can go in web.config instead of machine.config, so it's not a problem in hosted environments.

Browser caps change:

<browserCaps>
<!-- GECKO Based Browsers (Netscape 6+, Firebird, Firefox ..) -->
<case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)?(?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*">
browser=Gecko
type=${type}
frames=true
tables=true
cookies=true
javascript=true
javaapplets=true
ecmascriptversion=1.5
w3cdomversion=1.0
css1=true
css2=true
xml=true
tagwriter=System.Web.UI.HtmlTextWriter
<case match="^b" with="${letters}">
beta=true
</case>
</case>
</browserCaps>
Saturday, March 26, 2005 1:02 AM by Keyvan Nayyeri

# re: Validation Controls not working on Firefox

Thank you for this point.
I hate dislike Firefox and think Maxthon is better :D
Saturday, March 26, 2005 1:15 PM by Jon Galloway

# re: Validation Controls not working on Firefox

The bug is in ASP.NET, not Firefox. ASP.NET incorrectly identifies Firefox as a downlevel browser.
Sunday, April 10, 2005 7:06 AM by TrackBack

# re:Validation Controls not working on Firefox

^_^,Pretty Good!
Thursday, June 28, 2007 1:44 AM by Himaghnya

# re: Validation Controls not working on Firefox

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

Friday, September 28, 2007 3:08 AM by amit kumar jain

# re: Validation Controls not working on Firefox

<browserCaps>

<!-- GECKO Based Browsers (Netscape 6+, Firebird, Firefox ..) -->

<case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)?(?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*">

browser=Gecko

type=${type}

frames=true

tables=true

cookies=true

javascript=true

javaapplets=true

ecmascriptversion=1.5

w3cdomversion=1.0

css1=true

css2=true

xml=true

tagwriter=System.Web.UI.HtmlTextWriter

<case match="^b" with="${letters}">

beta=true

</case>

</case>

</browserCaps>

these things are not working in my application. Is there any way so that i can confirm these will be work or not

is there any other configuration required use above browser caps

Friday, November 16, 2007 12:58 AM by madhu

# re: Validation Controls not working on Firefox

Please can anyone tell me how can implement Group Validation in Firefox

Friday, August 15, 2008 6:38 AM by sajid

# re: Validation Controls not working on Firefox

Can any one tell me about the problem

Friday, October 24, 2008 11:09 AM by DotnetFan

# re: Validation Controls not working on Firefox

Hi,

The issue is that the default ASP.NET validation controls do not work properly for non-Microsoft browsers. This is due to the fact that document.all[ID] is used in place of document.getElementById(ID).

The problem with document.all[ID] is that Microsoft's Internet Explorer is the only browser that supports this non-standard technique for referencing an element in the HTML document. The standard way (which Internet Explorer does support, along with Mozilla, Netscape, Opera, and others), is: document.getElementById(ID).

Reference : aspnet.4guysfromrolla.com/.../051204-1.aspx

Wednesday, November 12, 2008 10:17 PM by Buspar.

# Buspar.

What is buspar. Buspar. Buspar and weight gain. Buspar and hostility. Buspar experience.

Leave a Comment

(required) 
(required) 
(optional)
(required)