Client-Side Validation using ASP.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear Justin,

Thanks for your reply!

Let me explain you my concern in detail....

I have a login field which I am validating using
RequiredValidator control. Now when a user omits this
field, the ErrorMessage is displayed successfully with the
help of validator control, but the page is still being
posted back to the server.

As you said, if the validation is done successfully at the
client-side, server-side validation is skipped. But I want
to stop the postback completely if the user omits the
login field. Can this be done using ASP.NET?

Thanks in advance!
 
The RequiredTextValidator and any of the other validators supplied by
Microsoft stop post back automatically when the page is submitted and an
error occurs. Here are some guidelines that cause post back anyway:

1. The EnableClientScript property is false on the validator.
2. Client-side validation is only supported on IE and IE/Mac browsers. All
other browsers post back. (I sell a replacement to Microsoft's validators
called "Professional Validation And More" that supports validation on IE,
IE/Mac, Netscape 6+, Mozilla, Opera 7, and Safari. Learn more at
http://www.peterblum.com/vam/home.aspx.)
3. The end user has disabled javascript on their browser
4. The Javascript files supplied by Microsoft for client-side validation are
not properly installed and therefore are not loaded into the page. See the
aspnet_regiis.exe utility to fix this.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
 
Back
Top