Problem in LinkButton

Discussion in 'ASP .Net Web Controls' started by Abhijit, Jul 15, 2003.

  1. Abhijit

    Abhijit Guest

    On a aspx page I am having one button that causes
    validation(Save button) , other button that dont causes
    validation (Cancel button) and a link button that
    causesvalidation. The click of cancel button shows
    different behaviours if the page is not valid.

    Case 1. (no problem case)
    If I click save button and if the page is not
    valid and then click cancel button the user is redirected
    to other page as cancel button dont cause validation.

    case 2: (problematic case)
    If the user clicks link button and page is not
    valid.Then after click of Cancel button nothing
    happens.The user is not redirected.But if the Cancel
    button is clicked second time he is redirected.

    This happens only if we have link button on the page
    and that causes validation.

    Is anyone having the solution ?
     
    Abhijit, Jul 15, 2003
    #1
    1. Advertising

  2. Hi


    By default, page validation is performed when a
    LinkButton control is clicked. Page validation determines
    whether the input controls associated with a validation
    control on the page all pass the validation rules
    specified by the validation control.

    You can specify or determine whether validation is
    performed on both the client and the server when a
    LinkButton control is clicked by using the
    CausesValidation property. To prevent validation from
    being performed, set the CausesValidation property to
    false.

    This property is commonly set to false for a reset or
    clear button to prevent validation from being performed
    when the button is clicked.




    HTH
    Ravikanth


    >-----Original Message-----
    >On a aspx page I am having one button that causes
    >validation(Save button) , other button that dont causes
    >validation (Cancel button) and a link button that
    >causesvalidation. The click of cancel button shows
    >different behaviours if the page is not valid.
    >
    >Case 1. (no problem case)
    > If I click save button and if the page is not
    >valid and then click cancel button the user is

    redirected
    >to other page as cancel button dont cause validation.
    >
    >case 2: (problematic case)
    > If the user clicks link button and page is not
    >valid.Then after click of Cancel button nothing
    >happens.The user is not redirected.But if the Cancel
    >button is clicked second time he is redirected.
    >
    > This happens only if we have link button on the

    page
    >and that causes validation.
    >
    > Is anyone having the solution ?
    >
    >.
    >
     
    Ravikanth[MVP], Jul 16, 2003
    #2
    1. Advertising

  3. Abhijit

    Abhijit Raje Guest

    Hi Ravikanth !!

    I want the link button to cause validation.But once the link button
    causes validation and the page is invalid and then you click
    cancel(which dont cuases validation) button then nothing happens for the
    first time but if I click it second time user is redirected. So why it
    is not happening at the first time ?

    Thanks and regards,

    Abhijit




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Abhijit Raje, Jul 16, 2003
    #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. Mike

    LinkButton Problem

    Mike, Feb 27, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    668
  2. Rob Meade

    LinkButton / doPostBack problem

    Rob Meade, Aug 25, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,075
    Raterus
    Aug 25, 2004
  3. Henri
    Replies:
    2
    Views:
    756
    Henri
    Oct 5, 2004
  4. Sathyaish
    Replies:
    3
    Views:
    3,154
    Sathyaish
    Sep 8, 2005
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    209
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page