You must Sign In to post a response.
  • Category: ASP.NET

    Button click event not fire at first time i click

    I have a web form that uses a Save button (see below) to save data. When I open the page and enter data and click on the Save button the page refreshes (as in a post back) but it doesn't save the changes. I don't get any error messages either. If I click it a second time it saves the data. I've tried all methods of debugging I can think of, but I can't find the problem. The click event doesn't appear to fire the first time, but it does fire the second time. Any idea what the problem is?

    <asp:linkbutton id="SaveButton" text="Save" OnClick="SaveButton_Click" runat="server"/>
  • #417144
    Hi dhaval,

    It is very difficult to figure out what's the issue by guessing .It is returning false on first click.Do one thing change it to asp button and check..

    DNS MVM and .Net Guru
    Team Lead at CirrusCloud Systems
    Thanks and Regards,
    Abhay Kumar Raut

  • #417151

    Check the Page Tag


    the above might set to false change to true

    it should look like

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="Default9" %>

    hope that will give you an idea

  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.