473,396 Members | 2,129 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,396 software developers and data experts.

Validators and Dynamic Controls

I have developed a tab user control in which each tab is itself a user
control and the tab selection control is a datalist.

Each tabbed user control has zero or more validator controls on it. The
hosting page has a summary validator on it.

Each tabbed user control is created dynamically on page_init (on both
postback and not postback), but only the tabbed user control which
corresponds to the selected tab is marked as visible. This has the
effect of only the selected tabbed user control being rendered to the
output page.

Validation works as expected for the selected tabbed user control.
However, when the page is submitted, the summary validator can only
validate the selected tabbed user control (on the client).

What I want to do, is on submit, run through all of the validators on
the page and determine if any of the tabbed user controls that were not
active when the page was submitted have errors.

(A secondary desire is to be able to do a summary validation on the
page that is being deselected when a different tab is selected, but
I'll save that for another time.)

In my event handler for the submit button, I iterate through the
Validators collection and call Validate() on each IValidator object.
Even though one of the tabbed user controls have an error, that
validator (a RequiredValidator) says it is valid.

Does this ring any bells with anyone?

thanks
peter

Nov 19 '05 #1
1 1345
You can always diable the validaiton on individual validation controls. So
you could have all the validators on all tabs, but then disable them all
except for the ones on the current tab. I don't know how appealing that approach
is to you.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I have developed a tab user control in which each tab is itself a user
control and the tab selection control is a datalist.

Each tabbed user control has zero or more validator controls on it.
The hosting page has a summary validator on it.

Each tabbed user control is created dynamically on page_init (on both
postback and not postback), but only the tabbed user control which
corresponds to the selected tab is marked as visible. This has the
effect of only the selected tabbed user control being rendered to the
output page.

Validation works as expected for the selected tabbed user control.
However, when the page is submitted, the summary validator can only
validate the selected tabbed user control (on the client).

What I want to do, is on submit, run through all of the validators on
the page and determine if any of the tabbed user controls that were
not active when the page was submitted have errors.

(A secondary desire is to be able to do a summary validation on the
page that is being deselected when a different tab is selected, but
I'll save that for another time.)

In my event handler for the submit button, I iterate through the
Validators collection and call Validate() on each IValidator object.
Even though one of the tabbed user controls have an error, that
validator (a RequiredValidator) says it is valid.

Does this ring any bells with anyone?

thanks
peter


Nov 19 '05 #2

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

Similar topics

1
by: Tom Pearson | last post by:
I create controls and validators dynamically dependent on data at runtime. I create the control then the relevant validator(s) for it assigning the Control.ID as the control to validate. These...
0
by: Tom Pearson | last post by:
I create controls and validators dynamically dependent on data at runtime. I create the control then the relevant validator(s) for it assigning the Control.ID as the control to validate. These...
2
by: Ken McAndrew | last post by:
I'm working on a timesheet project that involves creating textboxes and validators dynamically, and setting them in a placeholder to build a table. The Regular Expression validator works fine,...
1
by: tshad | last post by:
Is there a way to tell the validators to not fire if one of the validators fails the input? For example: In the following code, if someone doesn't enter anything in the field, I should get...
2
by: Mike Surcouf | last post by:
Hi I have some regex validators on my page set to dynamic and like the way they appear after you tab out of a field and also when you try to postback the form. All OK so far When I register...
3
by: rgparkins | last post by:
Hi I am currently having problems with Validators in a user control. I am creating a wizard sign-up process which have the allocated step (hyperlinks" at the top of the page. A user can also...
0
by: Mike Collins | last post by:
I have a form where I create dynamic controls at runtime. With this, I am adding a dynamic required field validators to each control as needed, but the validators are not firing when I click...
5
by: shapper | last post by:
Hello, Is there any way to make ASP.NET validators to display as block? I tried everything I could think off with skins, css, etc. I really don't know what else to try. Shouldn't this be...
4
by: Madhur | last post by:
Hello All I am learning how to use ASP.NET Validators and would appreciate if someone could provide me with guidance. I have written very simple ASPX page below with a Dropdown list, a...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.