Groups | Blog | Home
all groups > asp.net > march 2004 >

asp.net : Not to validate whole page


Hardy Wang
3/18/2004 10:42:14 PM
Hi all,
I have an ASPX page with several controls to be validated on clicking
some button. I also have a ASCX control in this page.
Is there a way I can control the button in ASCX control only to validate
input within ASCX control range? Right now, when I clicked button in
customer control, it will also validate input in main page. My concept is to
divide this page into chunks by using customer controls, and buttons within
each chunk are only responsible for input of that certain chunk.

Thanks for any suggestion!

--



WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy

Joe Gass
3/19/2004 9:12:07 AM
Hi Hardy
The validators that come with .net don't do this
I've developed a set of validator controls that allow you to group them into
logical forms.

e.g.
<extendedvalidators:RequiredFieldValidator id="RequiredFieldValidator2"
runat="server" ErrorMessage="type something" ControlToValidate="TextBox1"
group="1"></extendedvalidators:RequiredFieldValidator>

In the future I'd like to sell them (after a bit more testing). So far a
couple of people who have posted similar questions have found that they
work.
If you like to try them mail me at jonathangass@hotmail.com and I'll send
you the dll, let me know if you are using visual studio version 2002 or 2003
Cheers
Joe Gass
MCSD.net

[quoted text, click to view]

Peter Blum
3/19/2004 1:58:06 PM
Hi Hardy,

The concept that you describe will become the "validation groups" feature of
ASP.NET 2.0. You will be able to assign a group name to the submit button
and the validators it fires. My product, "Professional Validation And More"
at http://www.peterblum.com/vam/home.aspx, includes validation groups in its
22 validators. Its designed to overcome the numerous limitations of the
existing validators and greatly reduce the custom coding and hacks you need
with those validators. I've put together a list of 19 limitations in the
existing validators at http://www.peterblum.com/vam/valmain.aspx that you
can use to plan your validation effort.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

[quoted text, click to view]

AddThis Social Bookmark Button