473,770 Members | 4,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set few validation groups for one control? (ASP.NET 2.0)

Hi all.

I have following problem:
I have some user control called smallUserContrl , in which I have two
RangeValidator controls. I set their ValidationGroup property to
smallUserContro lGroup.

Also I have another user control called bigUserControl, in which I use
smallUserContro l. BigUserControl also has some validator, which has
ValidationGroup property set to bigUserControlG roup.

The problem is that I want to fire both validations at once
(smallUserContr olGroup and bigUserControlG roup). Of course I could set
ValidationGroup property in both user controls to the same value, but
it is not a good solution. Imagine such situation: I have some page and
put there BigUserControl (which includes SmallUserContro l) and also
another SmalUserControl . In such situation every validator control on
my page will be fired and that is not good, because maybe I would like
to fire validators only from bigUserControl.

Solution for this might be setting few ValidationGroup s for one control
e.g. button, but it doesn't work.

Is there some other solution?

Thanks in advance

Mar 9 '06 #1
1 3825
Even when Microsoft adds a new feature to address the limitations of their
past work, they don't always make it handle all the cases. Your case is a
reasonable one and not supported by validation groups in ASP.NET 2.0. That
system only matches to a single group name.

My Professional Validation And More (http://www.peterblum.com/vam/home.aspx)
is a replacement to the original validators. It handles this case. Its
validation groups permit one group, a list of groups
("groupname1|gr oupname2") and all groups using the token ("*").

Aside from that, you would have to develop some kind of hack.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"misiek" <pt*********@po czta.fm> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
Hi all.

I have following problem:
I have some user control called smallUserContrl , in which I have two
RangeValidator controls. I set their ValidationGroup property to
smallUserContro lGroup.

Also I have another user control called bigUserControl, in which I use
smallUserContro l. BigUserControl also has some validator, which has
ValidationGroup property set to bigUserControlG roup.

The problem is that I want to fire both validations at once
(smallUserContr olGroup and bigUserControlG roup). Of course I could set
ValidationGroup property in both user controls to the same value, but
it is not a good solution. Imagine such situation: I have some page and
put there BigUserControl (which includes SmallUserContro l) and also
another SmalUserControl . In such situation every validator control on
my page will be fired and that is not good, because maybe I would like
to fire validators only from bigUserControl.

Solution for this might be setting few ValidationGroup s for one control
e.g. button, but it doesn't work.

Is there some other solution?

Thanks in advance

Mar 9 '06 #2

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

Similar topics

3
1260
by: Paul | last post by:
This is what I am trying to do *********************************form1*********************** Control 1 required field validator 1 Control 2 required field validator 2 Submit button 1 (works only if control 1 and 2 inputs are correct does not check control 3 or 4 input) Control 3 required field validator 3 Control 4 required field validator 4 Submit button 2 (works only if control 3 and 4 inputs are correct, does not check...
1
14372
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset button on my ASP.NET web page, and have an HTML reset button click clear 1) all validator text display and 2) validation summary display. Problem was clearing them and yet still leaving them working and visible if the user immediately began...
4
2976
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are linkbuttons which must not cause validation. I have found a setting "causeValidation" to disable the validation. Also on the page, I have a datagrid that I will edit lines on. I can click
1
1503
by: MattC | last post by:
I have a user control that contains several requiredFieldValidators. The page the control sits in has other RequiredFieldValidators. On submitting the form all the validators on the page fire and correctly validate. The validators in the control seem to validate but do not return true/IsValid as so my form is not submitted. I would like to do this ClientSide, the only resolution I can find is to perform the validation for the...
4
2710
by: ibiza | last post by:
Hi all, I have a small question concerning asp.net 2.0 validation groups. I have this (simplified) situation : Name Value _____ _____ |_____| |_____| _____ _____ |_____| |_____|
5
1910
by: Lloyd Dupont | last post by:
On my page the user is ask to set of question. Say there I have 2 controls like that == pseudo-C#-code for my control == class MyControl : CompositeControl { TextBox text; LinkButton button override void CreateChildControl() {
0
1805
by: Code Rodent | last post by:
Hi there, Please please could someone shed some like on a problem that I'm having using a combination of Wizards, ValidationGroups and ValidationSummary controls. What I want to do is to have a wizard that will take me through several steps, and at each step validate input data using RequiredFieldValidators etc. displaying any errors in a Validation Summary. The problem that I have is that I cannot seem to have a ValidationSummary...
1
3194
by: brantman | last post by:
Here is a question that needs to be revisited. I noticed that there are more that a few posts about this in this group and in custom controls. Here is the problem: When inheriting from a webcontrol, say textbox for example, and implementing the IValidator interface to make the control self-validating, the control fails to participate in validation groups. Using reflector, it is easy to see why; the page.validator casts all the controls in...
2
452
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 example, when the user clicks on the first submit button, it wont submit unless all the controls in group 1 are valid, likewise, when the user clicks on the 2nd submit button, it wont submit unless all the controls in group 2 are valid. thanks.
0
9439
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
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
10071
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
10017
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,...
1
7431
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
5326
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
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
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.