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

Validation not working

112 100+
Hello there...

can somebody guide me on this…

I have a panel (say, panel1) inside another panel (say, outer-panel)….The panel1 is visible only when a checkbox is checked in the outer-panel.

I have many text boxes in the panel1. I have to put a validation on all the boxes.
I have to enable the validations on certain conditions,say, if textbox 1 is filled only then the required-field validator for textbox 2 should be enabled and vice-versa.
I did write code in the page_load for this.
Expand|Select|Wrap|Line Numbers
  1. if (txt1.Text != "")
  2.             {
  3.                 required_txt2.Enabled = true;
  4.  
  5.             }
  6.             else
  7.             {
  8.                 required_txt2.Enabled = false;
  9.             }
  10.             if (txt2.Text != "")
  11.             {
  12.                 required_txt1.Enabled = true;
  13.             }
  14.             else
  15.             {
  16.                 required_txt1.Enabled = false;
  17.             }
This code does enable the validator but does not show any error if one the textboxes is not filled and the page gets submitted normally.
the asp code for the validators is,
Expand|Select|Wrap|Line Numbers
  1. <asp:RequiredFieldValidator ID="required_txt1" runat="server" ErrorMessage="Please enter the text."
  2.                     ControlToValidate="txt1" EnableClientScript="false" Enabled="false" Display="Dynamic"
  3.                     SetFocusOnError="true" ValidationGroup="Submit">*</asp:RequiredFieldValidator>
  4. <asp:RequiredFieldValidator ID="required_txt2" runat="server" Enabled="false" EnableClientScript="false"
  5.                     ErrorMessage="Please enter the text 2." ControlToValidate="txt2" SetFocusOnError="true"
  6.                     Display="Dynamic" ValidationGroup="Submit">*</asp:RequiredFieldValidator>
  7.  
Can somebody please tell me what could be the reason…thanks in advance….
Mar 23 '10 #1
0 994

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: earwicker | last post by:
I recently deployed a web application which contains a user registration form with the usual fields: name, address, email, password, etc. Each of the TextBoxes uses a validation control to verify...
3
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
2
by: GD | last post by:
Hi, There are serveral validation controls in our intranet application. The controls work fine on all of our local machines that have Windows XP professional operating systems on them. After...
1
by: Simon | last post by:
Hi, Has anyone experienced the problem where validation controls stop a previously working page from submitting. Sometimes, when I move between my work machine and my home machine validation...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
0
by: dhurwitz | last post by:
Hi, In my ASP.NET 2.0 web app, I have a user control, ucBinEdges, with several text boxes. The user control has several validation controls validating the Text of these text boxes -...
2
by: moondaddy | last post by:
How can I have a page with 2 different groups of controls (where each group of controls contain textboxes, validation controls and a submit button) and each group operate independently? for...
5
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 Hi All, We have developed a Web Application on Visual Studio 2005 (ASP.NET 2.0) and deployed it on the Client's...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.