Linkbutton submits the form but OnClick event does not get fired

Discussion in 'ASP .Net' started by Stan, Dec 2, 2003.

  1. Stan

    Stan Guest

    This is very weird - linkbutton submits the form, but the
    event handler is not being called:

    <asp:linkbutton Runat=server CssClass=NormalA
    OnClick=btnTest_Click>Test</asp:linkbutton>

    protected void btnTest_Click(object sender,
    System.EventArgs e)
    {
    Response.Write ("Test");
    }

    I can't figure out why...

    Thanks,

    -Stan
    Stan, Dec 2, 2003
    #1
    1. Advertising

  2. Hi Stan,

    I have tested this issue on my side but I cannot reproduce the problem.
    Please try the following testing steps on your side. ( I am using VS.NET
    2003/WinXP SP1/IE 6.0 SP1)

    1. Create a default C# Web application.

    2. Drag a LinkButton control to the Webform1.aspx. The following is the
    HTML code.

    <asp:LinkButton id="LinkButton1" style="Z-INDEX: 104; LEFT: 232px;
    POSITION: absolute; TOP: 160px"
    runat="server" Width="88px" Height="24px">LinkButton</asp:LinkButton>

    3. Double click the LinkButton to add the event handler in the
    WebForm1.aspx.cs file.

    private void LinkButton1_Click(object sender, System.EventArgs e)
    {
    Response.Write ("Test");
    }

    4. Build and test this issue.

    If I have misunderstood your concern, please feel f

    Best regards

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ┬ĘC www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
    Jacob Yang [MSFT], Dec 3, 2003
    #2
    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. Sathyaish
    Replies:
    3
    Views:
    3,100
    Sathyaish
    Sep 8, 2005
  2. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    182
    Sathyaish
    Sep 8, 2005
  3. Matthew Sims
    Replies:
    0
    Views:
    132
    Matthew Sims
    Mar 4, 2004
  4. Terry
    Replies:
    1
    Views:
    101
    Thomas 'PointedEars' Lahn
    Oct 15, 2007
  5. Terry
    Replies:
    6
    Views:
    156
    Thomas 'PointedEars' Lahn
    Oct 22, 2007
Loading...

Share This Page