Cannot close jquery dialog after radiobuttonlist click?
<p>I'm using the jquery ui dialog and I've got it set up so that it has a text box and a button.
You basically type something into the text box and click the button, it pulls some values from a database and loads a radiobutton list.  HTML markup looks like this:</p>

<pre><code> &lt;div id="dialog" title="Select Address"&gt;
        &lt;asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server"&gt;
        &lt;ContentTemplate&gt;
            &lt;div id="search" style="width:100%; text-align:center;"&gt;
                &lt;asp:TextBox ID="txtFindSearch" runat="server"&gt;&lt;/asp:TextBox&gt; 
                &lt;asp:Button ID="btnFindSearch" runat="server" Text="Search" 
                    onclick="btnFindSearch_Click" /&gt;
                &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
            &lt;/div&gt;
            &lt;div id="searchresults" style="width:100%;"&gt;
                &lt;asp:RadioButtonList ID="rbSearchResults" runat="server" AutoPostBack="True" 
                    CellSpacing="10" RepeatColumns="4" RepeatDirection="Horizontal" 
                    ToolTip="Select an address." 
                    onselectedindexchanged="rbSearchResults_SelectedIndexChanged"&gt;
                &lt;/asp:RadioButtonList&gt;
            &lt;/div&gt;
        &lt;/ContentTemplate&gt;
        &lt;/asp:UpdatePanel&gt;
        &lt;/div&gt;
</code></pre>

<p>In the code behind I can get the selected value like this:</p>

<pre><code> protected void rbSearchResults_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label1.Text = rbSearchResults.SelectedValue.ToString();
        }
</code></pre>

<p>My issue is I don't know how to close the jquery dialog box AFTER a selection is made from the radio button list.  I tried to do something like this in jquery:</p>

<pre><code>  $('#MainContent_rbSearchResults input').click(function () {
       $('#dialog').hide();
   });
</code></pre>

<p>Even if I throw an alert in there it doesn't display the alert.  If I view page source I see the div container but I don't see the radiobuttonlist, could it be because it is wrapped in an updatepanel?</p>

<p>How can I close the jquery ui dialog after I get a value (a click of the radiobuttonlist)?</p>

<h1>Edit</h1>

<p>I tried with this:</p>

<pre><code> protected void rbSearchResults_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label1.Text = rbSearchResults.SelectedValue.ToString();
            this.txtShipToName.Text = Label1.Text;
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "closedialog", "$(function(){$('#dialog').dialog('close');});", true);
        }
</code></pre>

<p>And this closes the dialog however my textbox txtShipToName never gets a value.  Even though if I step through the debug I see the value being assigned to it.  </p>
