We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem: Use updatepannel with button

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<br />
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
            <ej:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button">

<br />

        protected void Button1_Click(object sender, EventArgs e)
            Label1.Text = DateTime.Now.ToString();

        protected void Button2_Click(object Sender, Syncfusion.JavaScript.Web.ButtonEventArgs e)
            Label1.Text = DateTime.Now.ToString();

I add a ejButton and standard butto in update pannel, The standard button working correcly but the ejbutton didn't use update pannel but refresh all the page


3 Replies

FP Francis Paul Antony Raj Syncfusion Team April 3, 2017 09:50 AM UTC

Hi Emanuele, 
Thanks for contacting Syncfusion Support. 
From your query, we suspect that, issue occurs due to default Type of Button. To trigger the Server Side Click event, ensure Button Type set as “Button” since default Button Type is “Submit”. So, it gets submitted and refreshed the page if Button Type has not been specified. 
Also, the reported issue (‘server-side event not triggered properly’) might be occurs due to the following reasons. 
#1) Please check ej.webform.min.js file is referred after ej.web.all.min.js as mentioned below. 
#2) Please check asp:ScriptManager is referred in your ‘Site.Master’ page. 
<ej:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" Type="Button"></ej:Button> 
<head runat="server">   
    <%:Styles.Render("~/Content/ej/web/default-theme/ej.web.all.min.css") %>  
    <%: Scripts.Render("~/Scripts/jquery-1.10.2.min.js")%>  
    <%: Scripts.Render("~/Scripts/ej/ej.web.all.min.js")%>  
    <%: Scripts.Render("~/Scripts/ej/ej.webform.min.js")%>  
    <form runat="server">   
        <asp:ScriptManager runat="server">   
        <!--Other Codes-->   
Francis Paul A. 

EM emanuele April 3, 2017 12:14 PM UTC

Very Thanks

This Solution working correcly, I add type = Button and the ej:button start to work with update pannel


FP Francis Paul Antony Raj Syncfusion Team April 4, 2017 05:02 AM UTC

Hi Emanuele, 
Thanks for the update. 
Please let us know if you need further assistance on this. 
Francis Paul A. 

Live Chat Icon For mobile
Up arrow icon