Short circuiting validation controls

Discussion in 'ASP .Net' started by Pho Bo Vien, Apr 28, 2004.

  1. Pho Bo Vien

    Pho Bo Vien Guest

    I have several link buttons on a page and many validation controls.

    I want the validation controls to block the user from submitting the
    form unless their conditions are satisfied -- however, the controls seem
    to block all eventHandlers that are connected to link buttons.

    How can I distinguish which events the validation controls are to apply
    -- or can I /short-circuit/ the validation controls in my other link
    button event methods ?
    Pho Bo Vien, Apr 28, 2004
    #1
    1. Advertising

  2. Pho Bo Vien

    Scott Allen Guest

    Yes, set the CausesValidation property to false for the buttons where
    you do not need validation. The default is true.

    HTH,

    --
    Scott
    http://www.OdeToCode.com

    On Tue, 27 Apr 2004 23:32:24 GMT, Pho Bo Vien <>
    wrote:

    >I have several link buttons on a page and many validation controls.
    >
    >I want the validation controls to block the user from submitting the
    >form unless their conditions are satisfied -- however, the controls seem
    >to block all eventHandlers that are connected to link buttons.
    >
    >How can I distinguish which events the validation controls are to apply
    >-- or can I /short-circuit/ the validation controls in my other link
    >button event methods ?
    Scott Allen, Apr 28, 2004
    #2
    1. Advertising

  3. Pho Bo Vien

    WJ Guest

    You may consider casting the event sender and evaluate linkButton ID
    property and fire codes accordingly.
    Example: on the click event of "LinkButton1_Click(object sender,....)", you
    would do something like:

    LinkButton lb=(LinkButton)sender;
    string s=lb.ID.ToString();
    if(s=="Go Eat PHO")
    {
    //place codes here to verify/validate your wallet to ensure you have
    enough $$$ to buy PBV.
    if(YouDoNotHaveSufficient$$$)
    {
    set your LinkButtonToEatPho.Enabled to False :)....;
    }
    else GoEatPBV();
    }
    else if so on ....
    {
    }

    John


    "Pho Bo Vien" <> wrote in message
    news:...
    > I have several link buttons on a page and many validation controls.
    >
    > I want the validation controls to block the user from submitting the
    > form unless their conditions are satisfied -- however, the controls seem
    > to block all eventHandlers that are connected to link buttons.
    >
    > How can I distinguish which events the validation controls are to apply
    > -- or can I /short-circuit/ the validation controls in my other link
    > button event methods ?
    >
    WJ, Apr 28, 2004
    #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. ram

    Short circuiting..

    ram, Apr 3, 2004, in forum: C Programming
    Replies:
    3
    Views:
    429
  2. Dave Opstad
    Replies:
    16
    Views:
    464
    Duncan Booth
    Mar 11, 2005
  3. kj
    Replies:
    11
    Views:
    470
    Jean-Michel Pichavant
    Mar 23, 2010
  4. Billy Mays

    Short-circuiting in C

    Billy Mays, May 26, 2011, in forum: C Programming
    Replies:
    63
    Views:
    1,652
    88888 Dihedral
    Aug 28, 2012
  5. Andrea Crotti

    avoid import short-circuiting

    Andrea Crotti, Mar 16, 2012, in forum: Python
    Replies:
    0
    Views:
    125
    Andrea Crotti
    Mar 16, 2012
Loading...

Share This Page