Friday, August 5, 2022

ASP.NET C# button click Event handler on page load event- two event handler on one button

 <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn btn-info" 

                        onclick="btnSave_Click" ValidationGroup="Save1" />

<asp:Button ID="btnSearch" CausesValidation="false" runat="server" Text="Search" CssClass="btn btn-primary" 

              onclick="btnSearch_Click" />


aspx.cs page

protected void Page_Load(object sender, EventArgs e)

    {

btnSave.Click += new EventHandler(btnSearch_Click);

}

 protected void btnSearch_Click(object sender, EventArgs e)

    {

}

protected void btnSave_Click(object sender, EventArgs e)

    {

}

No comments:

Post a Comment