C# – Button OnClick not firing on first click in ASP.NET

asp.netc

protected void ButtonCancel_Click(object sender, EventArgs e)
    {

        Response.Redirect("~/Logon.aspx");
    }

this is not working when first click on cancel button?

Best Answer

Make sure you're binding to the event only when IsPostBack is true. Otherwise we won't know without more code.

Related Topic