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.
Unfortunately, activation email could not send to your email. Please try again.

Problem: Use updatepannel with button

Thread ID:

Created:

Updated:

Platform:

Replies:

129761 Apr 2,2017 01:14 PM Apr 4,2017 01:02 AM ASP.NET Web Forms 3
loading
Tags: Button
emanuele
Asked On April 2, 2017 01:14 PM

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
<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">
            </ej:Button>
          

<br />
        </ContentTemplate>
    </asp:UpdatePanel>


        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

Thanks
Emanuele

Francis Paul Antony Raj [Syncfusion]
Replied On April 3, 2017 05:50 AM

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. 
 
[.aspx] 
<ej:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" Type="Button"></ej:Button> 
 
[Site.Master]  
<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")%>  
</head>   
<body>   
    <form runat="server">   
        <asp:ScriptManager runat="server">   
               
        </asp:ScriptManager>   
        <!--Other Codes-->   
   </form>   
</body>    
 
 
Regards, 
Francis Paul A. 


emanuele
Replied On April 3, 2017 08:14 AM

Very Thanks

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

thanks
Emanuele 

Francis Paul Antony Raj [Syncfusion]
Replied On April 4, 2017 01:02 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;