Multiple validation problem

S

Shahar

hi
I have the following problem: I have two button, tow textboxes and two
RequiredFieldValidator controls, like that:

<form id="Form1" method="post" runat="server">
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="TextBox1"
id="RequiredFieldValidator1" runat="server"
ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>
<br><br>
<asp:TextBox id="Textbox2" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="TextBox2"
id="Requiredfieldvalidator2" runat="server"
ErrorMessage="*"></asp:RequiredFieldValidator>
<asp:Button id="Button2" runat="server" Text="Button"></asp:Button>
</form>

Can I make the RequiredFieldValidator1 to response only to Button1 and
RequiredFieldValidator2 response only to Button2 ?

Thanx.
 
J

Joe Gass

Hi Shahar
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)...
If you like to try them mail me at (e-mail address removed) 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
 
P

Peter Blum

You are describing a concept called "validation groups" that will be in
ASP.NET 2.0. That product is a long way out. I have a solution that provides
validation groups now and offers much more to help you with validation that
ASP.NET 2.0 and all other validation products do not cover. Take a look at
my product, "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx).

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

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top