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

Validators won't let me leave aspx form using web user controls!

If I have got 2 web user controls on my aspx form, and one web user
control has got some validator controls on it, what I find is that if
I enter in some "bad data" in to some text boxes on the first web user
control, then click on a link button on the second web user control to
leave the aspx form, it won't let me - the validators run on the first
web user control and highlight the errors and won't let me leave until
I fix them. I'm trapped.
Nov 18 '05 #1
4 1431
Validation controls work great for scenarios where you fill everything in
and submit (ie, simple forms). They get to be a pain in the butt when you
start dealing with complex logic and are best thrown out the window in those
cases. This may not be a popular statement, but it is factual.

You have a couple of choices.

1. Scrap the validation controls in this exercise.
2. Customize the validation to not validate on the second button push (could
be a coding nightmare, especially since you are dealing with controls in a
page).

I prefer the easy route, as the validation controls are meant to make your
life easier, not harder.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"Dot net work" <do***@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
If I have got 2 web user controls on my aspx form, and one web user
control has got some validator controls on it, what I find is that if
I enter in some "bad data" in to some text boxes on the first web user
control, then click on a link button on the second web user control to
leave the aspx form, it won't let me - the validators run on the first
web user control and highlight the errors and won't let me leave until
I fix them. I'm trapped.

Nov 18 '05 #2
The validators have an enabled property. You can use client side javascript
hooked up to each user controls button to disable the validators on the
oposite control.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Dot net work" <do***@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
If I have got 2 web user controls on my aspx form, and one web user
control has got some validator controls on it, what I find is that if
I enter in some "bad data" in to some text boxes on the first web user
control, then click on a link button on the second web user control to
leave the aspx form, it won't let me - the validators run on the first
web user control and highlight the errors and won't let me leave until
I fix them. I'm trapped.

Nov 18 '05 #3
Check out the following thread.

http://groups.google.com/groups?hl=e...D100%26hl%3Den

--

Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
"Dot net work" <do***@hotmail.com> wrote in message
news:77**************************@posting.google.c om...
If I have got 2 web user controls on my aspx form, and one web user
control has got some validator controls on it, what I find is that if
I enter in some "bad data" in to some text boxes on the first web user
control, then click on a link button on the second web user control to
leave the aspx form, it won't let me - the validators run on the first
web user control and highlight the errors and won't let me leave until
I fix them. I'm trapped.

Nov 18 '05 #4
Actually, I just found another workaround:

For the buttons and link buttons on the other web user control that
needs to override any validators on the first web user control, set
the CausesValidation property of these controls to false.

-dnw.

do***@hotmail.com (Dot net work) wrote in message news:<77**************************@posting.google. com>...
If I have got 2 web user controls on my aspx form, and one web user
control has got some validator controls on it, what I find is that if
I enter in some "bad data" in to some text boxes on the first web user
control, then click on a link button on the second web user control to
leave the aspx form, it won't let me - the validators run on the first
web user control and highlight the errors and won't let me leave until
I fix them. I'm trapped.

Nov 18 '05 #5

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

Similar topics

2
by: Christian H | last post by:
Based on the content in my database, I need to populate different form controls and validators, such as textbox, dropdownlist, requiredfieldvalidators , etc. Then I need to check if the form has...
1
by: Tony | last post by:
Hi folks, I've got a bit of a problem. I have a situation where I build forms completely dynamically based on a form definition supplied from a database. Anyway, I noticed that required fields...
1
by: Shaun | last post by:
I am using a base page (I think they're also called master pages) as a base that my webforms inherit from. The base page controls formating and common functions used throughout the site. This all...
4
by: jobz | last post by:
I have a multi-page form that contains various validators. When the user clicks the submit button, I want validators to fire in all panels, not just the one currently visible. Can anyone help? ...
1
by: epigram | last post by:
I'm trying to use the ASP.NET validators to check some client-side business rules. I've got two ASP TextBox controls (call them tbxYear1 and tbxYear2) used to enter a range of years. I've got a...
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...
1
by: Andrew Jocelyn | last post by:
Hi I have a Formview control in a UserControl. The server-side validation is not working, i.e. the events are not firing when a button control which causes validation is fired or even when...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.