Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Validators won't let me leave aspx form using web user controls!

Reply
Thread Tools

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

 
 
Dot net work
Guest
Posts: n/a
 
      06-16-2004
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.
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\) [MVP]
Guest
Posts: n/a
 
      06-16-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.



 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      06-16-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.



 
Reply With Quote
 
Alphonse Giambrone
Guest
Posts: n/a
 
      06-16-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.



 
Reply With Quote
 
Dot net work
Guest
Posts: n/a
 
      06-16-2004
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.

http://www.velocityreviews.com/forums/(E-Mail Removed) (Dot net work) wrote in message news:<(E-Mail Removed). 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Let me in! Let me in! quasi/various/bob [7.13.86.42] MCSE 7 05-30-2006 10:00 PM
Regular Expression validators NOT working, Required Field validators ARE working Ratman ASP .Net 0 09-14-2004 09:36 PM
Have a nice day! ...//more of your parables. Pray let us know whoyou are, let us Ravens U. Locksmith Python 1 05-26-2004 11:00 AM
winxp IE will not let you exit, and my comptuer / other folders will not let you open them. Daniel NZ Computing 2 05-11-2004 02:02 AM
Let or not let the text float Luigi Donatello Asero HTML 6 01-15-2004 04:08 PM



Advertisments