locked
Google API not working in Update Panel after Post back. Please help. RRS feed

  • Question

  • User-2038235140 posted

    Hi Guys,

    I am using Google API (GoogleChartsNGraphsControls.dll) for displaying Gauges or Dials in my ASP.NET web page.

    When the page is loaded first time dials are appearing correctly but as soosn as i do post-back then dials disappear.

    My Gauge controls are in Update Panel because i am using UpdateProgress Ajax control.

    This problem is not occuring when i remove Update Panel. But i want to use Update Panel to show progress bar.

    Please help.

    Thanks a lot in advance.

     

    Thursday, January 23, 2014 5:04 AM

Answers

  • User-417640953 posted

    This problem is not occuring when i remove Update Panel. But i want to use Update Panel to show progress bar.

    Hi sameer,

    Thank you post the issue to our forum.

    For this issue, I suggest you not using the UpdatePanel. And using the javascript show progress instead like below.

    <head runat="server">
        <title></title>
        <script>
            function ShowProgress() {
                document.getElementById("ProgressBar").style.display = "block";
            
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Button ID="Button1" runat="server" Text="Do-postback" onclick="Button1_Click" OnClientClick="ShowProgress()" />
            <div id="ProgressBar" style="display:none;">please wait for.....</div>
        </div>
        </form>
    </body>

    code behind:

     protected void Button1_Click(object sender, EventArgs e)
            {
                //test the progress
                System.Threading.Thread.Sleep(3000);
            }

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 24, 2014 9:09 AM

All replies

  • User-417640953 posted

    This problem is not occuring when i remove Update Panel. But i want to use Update Panel to show progress bar.

    Hi sameer,

    Thank you post the issue to our forum.

    For this issue, I suggest you not using the UpdatePanel. And using the javascript show progress instead like below.

    <head runat="server">
        <title></title>
        <script>
            function ShowProgress() {
                document.getElementById("ProgressBar").style.display = "block";
            
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Button ID="Button1" runat="server" Text="Do-postback" onclick="Button1_Click" OnClientClick="ShowProgress()" />
            <div id="ProgressBar" style="display:none;">please wait for.....</div>
        </div>
        </form>
    </body>

    code behind:

     protected void Button1_Click(object sender, EventArgs e)
            {
                //test the progress
                System.Threading.Thread.Sleep(3000);
            }

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 24, 2014 9:09 AM
  • User555306248 posted

    When the UpdatePanel refreshes, it destroys the DOM for those TextBoxes, removing the jQuery event handlers in the process.  Use pageLoad() instead of $(document).ready(), and they will be wired back up after every partial postback.

    http://forums.asp.net/t/1849379.aspx

     

    Sunday, January 26, 2014 10:58 PM