Is the RequiredFieldValidator a reliable control if supported with sensible form level coding?

H

Hazz

I needed to provide client side validation for a web forms text box, radio
button list, and drop down list.
I asked two developers I work with what they thought I should do. One said
Javascript, the other the Validation Controls.
I chose the RequiredFieldValidator although I had done considerable work
with Javascript in my ASP days.
In 3-5 minutes I had two controls validated and working. It took me a little
longer with the drop down list only because I had to append an empty string
as an item to that list so I could set that to the initial value. I also had
to disable the controls on other events and to enable the controls on Form
Load. But I loved their seemingly simple and effective solution for the
task!

I went to a meeting with my boss and two brand new programmers and mentioned
what I had done. My boss said that he had tried them but he found the
ASP.NET validation controls to be buggy. The other new developer said he had
some funny experience with them.

Are they robust, consistent, and reliable controls or not !!??? I would
really appreciate some wisdom here from veteran ASP.NET'ers.

Thank you very much. -hazz
 
B

Brock Allen

I went to a meeting with my boss and two brand new programmers and
mentioned what I had done. My boss said that he had tried them but he
found the ASP.NET validation controls to be buggy. The other new
developer said he had some funny experience with them.

Have them post what their problems were so we can set the straight. Perhaps
they were doing something wrong or perhaps they were expecting too much from
them.
Are they robust, consistent, and reliable controls or not !!??? I
would really appreciate some wisdom here from veteran ASP.NET'ers.

In my expereicne they are sufficient. It's a nice little validation framework
that deal with most of the tedious details of javascript validation you used
to have to do manually. One note is that they only do client side validation
is your browser has the initialis "I" and "E" and is at least version 5 (I
think it's version 5, IIRC). They always do server side validation as well
(regardless of the browser), which is important for security. The validation
controls take you about 80% of the way and with the CustomValidator you can
cover the other 20% of wacky scenarios you might have.
 
H

Hazz

Thank you so much Brock.
If they are considered sufficient for a developmentor instructor, they are
good enough for me.
Since this is an intranet app and IE is the browser, that browser req'mnt is
not a problem.
I didn't realize that the RequiredFieldValidator was validating on the
server in addition to its work on the client.
Appreciatively,
-hazz
 
B

Brock Allen

Well, I specifically used the word sufficient on purpose. They work well
in all of the situations where I've needed them to. But there are thrid party
validation controls out there. So to some people the built-in ones are not
sufficient. I'd say use the built-in ones until they can't handle what you
need/want anymore then if it's important consider the third party ones. But,
like I said, for all of the apps I've been building in ASP.NET, the built-in
ones have been sufficient :)
 
P

Peter Blum

Hi Hazz,

The basic idea of Microsoft's validators is very good. It provides
client-side validation on IE and provides server side validation on *all*
post backs. The problems it has are:
1. Its very feature poor. Users have asked for many features. A few will be
addressed in ASP.NET 2.0 but most are not going to be addressed because the
design of these controls doesn't bode well for the changes they want. A
number of third parties have developed replacements for these validators. I
am the author of the most popular one, "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx). In developing my stuff, I put
together a list of all of the limitations and requests users make of
Microsoft's validators: http://www.peterblum.com/vam/valmain.aspx. Look
through it so you know what many of the complaints are. Again, just switch
to a better system and get developing your web sites. (This is true with all
of the web controls: textboxes vs DatePickers, DataGrid, Calendar, etc).

2. Its documentation, like so much of ASP.NET Development Guide, isn't
written to quickly give you the right info. For example, its hard to find an
overview that tells you to use the Page.IsValid property in your Click post
back method and use the button's CausesValidation property to turn off
validation on Cancel button. Hopefully they will improve things in ASP.NET
2.0.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
H

Hazz

Thank you for your response Peter and for making me aware of some of the
caveats and limitations.
And thank you for making me aware of the alternative you provide.
-hazz
 

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

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top