473,671 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1448
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.goo gle.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 #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.goo gle.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 #3
Check out the following thread.

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

--

Alphonse Giambrone
Email: a-giam at customdatasolut ions dot us
"Dot net work" <do***@hotmail. com> wrote in message
news:77******** *************** ***@posting.goo gle.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 #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 CausesValidatio n property of these controls to false.

-dnw.

do***@hotmail.c om (Dot net work) wrote in message news:<77******* *************** ****@posting.go ogle.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
6471
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 been filled out correctly. If so, I need to update a database, and do other things. In order to check if the form is ok, I've tried looping through the validator controls, and I've also tried using page.isvalid.
1
3478
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 weren't validating on the server side, so I've whittled the code down to the example below which illustrates the problem. Basically, when I programmatically create a control and a required field validator, and don't use client side validation,...
1
1274
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 works great until I want to use a validator. Any validators added to the page do not fire. I can leave a required textbox blank, and the code happily chugs through processing the button click code. After some research, I've found that some...
4
1407
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? jobz
1
2112
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 couple things I need to check: 1) tbxYear1 and tbxYear2 are both optional, but if values are entered they have to integers and non-negative 2) if values are entered for both tbxYear1 and tbxYear2 then tbxYear1 must be less than tbxYear2 It...
2
1727
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 for the client side event of a textbox using ... textBox.Attributes.Add("onKeyUp","javascriptfunction");
3
1935
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 click next/previous. Dependant on the current step in the sign-up process I am loading a new user control as I dont want to have 7-8 pages, just one page and load the control dynamically. All is sweet at the moment apart from the validation...
1
3097
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 Page.Validate() is explicitly called. I'm loading the FormView as an IBindableTemplate as in this article but I don't think this is the reason for the validation not working. http://www.developerfusion.co.uk/show/4721/
4
1263
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 button. If a value of 3 is selected inside dropdown list , I add two text boxes each attached with validators.
0
8476
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6229
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1809
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.