ASP.NET page runs differently in certain Browser (IE / Firefox (mozilla) )

B

bienwell

Hi all,

I have a problem with the program in ASP.NET. I have a web page that let
users change their passwords with a regularexpressionvalidator that
validates against the new password (8 characters or more) as below. The
page works fine with IE browser. When a user enter a new password that does
not match with this rule (for example "a", he will receive an error
"Invalid password!" from client side. On the contrary, when user uses
Firefox (mozilla) browser, he tried to enter one character "a" ; the page
accepted this data without displaying an error message ="Invalid password!"
from regularexpressionvalidator and saved that password into the table.

What's wrong with this ? What should I do to make the page work properly
with any browser ? Please help!
Thanks in advance.

<td class="dataTD" style="FONT-SIZE: 10pt; WIDTH: 185px"><asp:label
id="LblNew" runat="server" Width="123px">New

Password :</asp:label><label for="NewPassword"></label></td>

<td class="dataTD" style="FONT-SIZE: 10pt"><asp:textbox id="NewPassword"
runat="server" Width="145px" TextMode="Password"></asp:textbox>&nbsp;&nbsp;

<asp:regularexpressionvalidator id="RegularExpressionValidator1"
runat="server" ForeColor="LightCoral" ErrorMessage="Invalid password!"

Display="Dynamic"
ValidationExpression="(?!^[0-9A-Z\W]*$)(?!^[a-zA-Z\W]*$)(?!^[a-z0-9\W]*$)(?!^[0-9a-zA-Z]*$)^([a-zA-Z0-9\W]{8,})$"

ControlToValidate="NewPassword"></asp:regularexpressionvalidator><asp:label
id="ErrNewPassword" runat="server" Width="281px"
ForeColor="LightCoral"></asp:label></td>


Firefox (mozilla) browser.
 
M

Mark Rae [MVP]

What's wrong with this ? What should I do to make the page work properly
with any browser ? Please help!

Generally speaking, when things work in IE but not in other browsers, it's
because of IE's lack of support for web standards and use of proprietary
functionality. IE7 is much improved in this respect, but earlier versions
(especially IE6) were terrible.

Judging by the markup, I'd say you're not validating your page for
XHTML-compliance. Specifically, you have upper-case style tags, which are
not permitted in XHTML...

Once you have sorted that out, it's a good idea to develop against FireFox
rather than IE...
 
B

bienwell

How about the code I've sent to you. Do I need to fix anything to make it
work in any browsers? I used the web controls in ASP.NET for the validation
in client side and it ignored this validation when using Firefox. If so, it
is the weak points of ASP.NET ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top