Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Validation Groups

Reply
Thread Tools

Validation Groups

 
 
moondaddy
Guest
Posts: n/a
 
      10-14-2006
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.


--
http://www.velocityreviews.com/forums/(E-Mail Removed)ail


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      10-14-2006
Using ASP.NET 2.0? Doesn't just specifying ValidationGroup="your_group_name"
on these controls respectively work?


--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


"moondaddy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
> --
> (E-Mail Removed)ail
>



 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      10-16-2006
Hello Moondaddy,

If you're developing the page through ASP.NET 2.0, as Teemu has suggested,
you can consider utilize the ValidationGroup in ASP.NET 2.0. This is a new
feature added in ASP.NET 2.0 react to the feedback about the ASP.NET 1.1
validation control's limitation. We can configure validation controls,
summarycontrol, submit buttons to be grouped by certain group names and a
submit button configured in a certain group can only trigger the valiation
of validators in that corresponding group.

#Specifying Validation Groups
http://msdn2.microsoft.com/en-us/library/ms227424.aspx

#Changes to the Validation Controls in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/ms379607.aspx


So for your scenario, each of your usercontrol will has own set of input
entries and validation controls, you can consider make each usercontrol an
individual Validation Group scope so that the validation in one
usercontrol(group) won't affect the ones in another usercontrol(group).

The above msdn link has provided typical sample demonstrating the usage of
validation group of ASP.NET 2.0 validators.

Please feel free to post here if there is anything unclear or any other
questions on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.





 
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
Groups of groups with PIX. AM Cisco 2 01-31-2006 04:37 PM
match groups: optional groups not accessible david.reitter@gmail.com Python 3 06-10-2005 05:03 PM
getting values from URL such as http://groups.google.co.uk/groups?q=parameters+url+asp.net&start=10&hl=en&lr=& anonymous ASP .Net 1 05-08-2005 03:58 PM
Windows groups, VPN groups, and SecureACS John Sasso Cisco 0 10-02-2004 03:39 PM
Reading membership of groups (including nested groups) Petra Hübner ASP .Net 0 02-16-2004 07:07 PM



Advertisments