Validation Groups

Discussion in 'ASP .Net' started by moondaddy, Oct 14, 2006.

  1. moondaddy

    moondaddy Guest

    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.


    --
    ail
    moondaddy, Oct 14, 2006
    #1
    1. Advertising

  2. moondaddy

    Teemu Keiski Guest

    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" <> wrote in message
    news:...
    > 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.
    >
    >
    > --
    > ail
    >
    Teemu Keiski, Oct 14, 2006
    #2
    1. Advertising

  3. 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/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.

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



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Oct 16, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Petra Hübner
    Replies:
    0
    Views:
    426
    Petra Hübner
    Feb 16, 2004
  2. =?Utf-8?B?UGF1bA==?=

    2 seperate validation groups on 1 page?

    =?Utf-8?B?UGF1bA==?=, Aug 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    389
    Peter Blum
    Aug 4, 2004
  3. john morales

    2 validation groups problem

    john morales, Dec 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    392
    Peter Blum
    Dec 14, 2004
  4. anonymous
    Replies:
    1
    Views:
    4,530
    Francisco Padron
    May 8, 2005
  5. Replies:
    3
    Views:
    347
    Peter Hansen
    Jun 10, 2005
Loading...

Share This Page