Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1810
Client-side event lost on callback
posted

I´m attaching a double-click client-side event on an dynamically created gauge. At first time works ok but after a callback on the update panel where the gauge is, there is no more client-side doble-click.

Any idea?

Parents
  • 28496
    Offline posted

    the following code worked for me.  clicking the button inside the refreshpanel caused an async postback, and the gauge doubleclick handler was still intact.  is this what you're trying to do?

     <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register assembly="Infragistics2.WebUI.Misc.v8.3, Version=8.3.20083.2028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
            <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server"
                Height="20px" Width="80px">
                <asp:Button ID="Button1" runat="server" Text="Button" />
            </igmisc:WebAsyncRefreshPanel>
        
        </div>
        </form>
    </body>
    </html>

         protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "gaugeDblClick", "<script type='text/javascript'>function test() { alert('hello'); }</script>");
            }
            UltraGauge ultraGauge1 = new UltraGauge();
            ultraGauge1.ID = "ultraGauge1";
            ultraGauge1.ClientSideEvents.DblClick = "test";
            ultraGauge1.BackColor = Color.PaleGreen;
            this.WebAsyncRefreshPanel1.Controls.Add(ultraGauge1);


        }

Reply Children