473,386 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Multiple validation problem

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.
Nov 18 '05 #1
2 3379
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 jo**********@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

"Shahar" <sh****@log-on.com> wrote in message
news:e8**************************@posting.google.c om...
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.

Nov 18 '05 #2
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Shahar" <sh****@log-on.com> wrote in message
news:e8**************************@posting.google.c om...
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.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in...
0
by: Richard Payne | last post by:
I am developing a web application that utilises multiple grids, panels, validation controls etc on the same page. I have added the appropriate code to pop up dialogs to confirm delete in...
8
by: TJS | last post by:
what are folks doing to get around limitation of one server form per page ?
1
by: Ken Varn | last post by:
If a page has multiple ValidationSummary controls, how does it distinguish which ValidationControls are associated with which ValidationSummary controls? The reason I am asking this is that I...
0
by: koen | last post by:
Hi! In asp.net (version 1.1) I run into a problem when trying to perform client validation. The error I get on the client-side is : "Error: expected ';'". This problem occurs when I place a...
6
by: Peter M. | last post by:
Hi all, If an event has multiple subscribers, is it possible to cancel the invocation of event handlers from an event handler? Or to be more specific: I'm subscribing to the ColumnChanging...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.