Client-Side Validation using ASP.NET

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!
 
P

Peter Blum

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)
 

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

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top