Category / Section
How to trigger server side event for a button control?
1 min read
Description
Button control defined with server side OnClick event did not hit the corresponding server side event handler, however a post back occurs on Button click event.
Solution
To trigger the server-side events for an EJ Button control, you have to set the Type property value as Button. So that on post back the corresponding event handler is mapped with the Button click.
ASPX
<%--EJ Button in the view page--%> <ej:Button ID="ejbtn" runat="server" Type="Button" Text="EJ Click" OnClick="ejbtn_Click"></ej:Button>
C#
protected void ejbtn_Click(object Sender, Syncfusion.JavaScript.Web.ButtonEventArgs e) { //Your function here }