jQuery not responding after calling backend function using ASP.NET with jQuery
<p>I have a simple WebForm, after I click a button on the form, jQuery give me a popup modal.
But after I click a button in the popup calling a backend function which return a string to a textbox in the popup, the popup wouldn't respond to the close popup modal.</p>

<p>Below is my code;</p>

<p>ASP frontend:</p>

<pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ABC.WebForm1" %&gt;
&lt;asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
&lt;link rel="stylesheet" href="JStyles/jquery.ui.all.css"&gt;
&lt;script src="JQScripts/jquery-1.7.2.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.bgiframe-2.1.2.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.core.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.widget.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.mouse.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.draggable.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.position.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.resizable.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.ui.dialog.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.core.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.blind.js" &gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.transfer.js" &gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.bounce.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.clip.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.core.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.drop.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.explode.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.fade.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.fold.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.highlight.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.pulsate.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.scale.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.shake.js"&gt;&lt;/script&gt;
&lt;script src="JQScripts/jquery.effects.slide.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" language="javascript"&gt;
    // increase the default animation speed to exaggerate the effect
    $.fx.speeds._default = 500;
    $(function () {
        $("#dialog").dialog({
            autoOpen: false,
            show: "blind",
            hide: "blind",
            width: 600,
            height: 500,
        });

        $("#Close").click(function(){
            $("#dialog").dialog("close");

        });

        $("#opener").click(function () {
            $("#dialog").dialog("open");
            return false;
        });

    });

     function onClick() {
            document.getElementById('&lt;%=btnTest.ClientID%&gt;').click();    
        }


    &lt;/script&gt;
    &lt;div class="demo"&gt;

&lt;div id="dialog" title="Basic dialog"&gt;
&lt;asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional"&gt;
    &lt;ContentTemplate&gt;
    &lt;asp:Panel runat="server" ID="Panel" &gt;
        &lt;table width="100%"&gt;
            &lt;tr&gt;
                &lt;td&gt;
                       &lt;asp:TextBox runat="server" ID="txt" Width="300" &gt;&lt;/asp:TextBox&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;
                    &lt;asp:Button runat="server" ID="btn" Text="test" Width="80px" OnClientClick="onClick();"  /&gt;
                    &lt;button id="Close"&gt;Close&lt;/button&gt;
                &lt;/td&gt;
             &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/asp:Panel&gt;
    &lt;/ContentTemplate&gt;
    &lt;Triggers&gt;
        &lt;asp:AsyncPostBackTrigger ControlID="btnTest" EventName="Click" /&gt;
    &lt;/Triggers&gt;
    &lt;/asp:UpdatePanel&gt;
&lt;/div&gt;

&lt;button id="opener"&gt;Open Dialog&lt;/button&gt;
 &lt;asp:Button runat="server" ID="btnTest" Text="teest" onclick="btnTest_Click" /&gt;
&lt;/div&gt;&lt;!-- End demo --&gt;





&lt;div class="demo-description"&gt;
&lt;p&gt;Dialogs may be animated by specifying an effect for the show and/or hide properties.  You must include the individual effects file for any effects you would like to use.&lt;/p&gt;
&lt;/div&gt;

&lt;/asp:Content&gt;
</code></pre>

<p>Backend:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ABC
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_Click(object sender, EventArgs e)
        {

        }

        protected void btnTest_Click(object sender, EventArgs e)
        {
            txt.Text = "ABC";

        }
    }
}
</code></pre>
