473,322 Members | 1,401 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,322 software developers and data experts.

How to have One RequiredFieldValidator to Validate Two TextBox

How can I have only one RequiredFieldValidator to control two TextBox webcontrols so that only one message is displayed

<asp:Label id="lbl_UserName" runat="server"></asp:Label><br>
<asp:TextBox id="txt_UserName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator id="R_lbl_UserName" runat="server" ControlToValidate="txt_UserName" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
<br>
<asp:Label id="lbl_Password" runat="server"></asp:Label><br>
<asp:TextBox id="txt_Password" runat="server" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator id="R_lbl_Password" runat="server" ControlToValidate="txt_Password" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

Nov 18 '05 #1
0 2011

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

Similar topics

1
by: ad | last post by:
I want to combine a TextBox and a RequiredFieldValidator into to a web custom control (name RequireTextBox ), But when I use RequireTextBox in web form, the RequiredFieldValidator has no action....
11
by: Tom | last post by:
Hi all, I posted the same question one week ago in http://communities.microsoft.com/newsgroups/previewFrame.as p? ICP=msdn&sLCID=us&sgroupURL=microsoft.public.dotnet.framewo...
5
by: Columbia Pike | last post by:
Hi, I'm trying to have a login page; after logging in the user has to see the list of SQL Server Databases available to him/her. I'm always getting the error 'ASP.login_aspx' does not contain a...
0
by: Mark Derman | last post by:
Hi All OK, this one has me baffled and infuriated!?!?!?! I've unfortunately upgraded our W2003 server to dotNET 1.1 SP1 and it appears that validation controls with EnableClientScript=true...
5
by: Lloyd Dupont | last post by:
On my page the user is ask to set of question. Say there I have 2 controls like that == pseudo-C#-code for my control == class MyControl : CompositeControl { TextBox text; LinkButton button ...
1
by: Anup | last post by:
Hi Group, In my project I m using "RequiredFieldValidator" for the validations of text box, There are two TextBox, say "txtBox1" and "txtBox2" now I want to make either of TextBox mandatory,...
3
by: AG | last post by:
Below is code (slightly modified and converted to VB) that was provided to me in response to another post. I am using it to demonstrate another problem. In order for paging and other features to...
0
by: MatsL | last post by:
If I create a simple form with a panel a textbox and button and a RequiredFieldValidator for the textbox. I define the default button on the panel. When i open the form and press enter i get a...
2
by: Christina | last post by:
Hello !! I am creating a dynamic textbox and want to validate it using the requiredfieldvalidator. These are the steps which I tried: ==================================================== 1)...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.