title: jQuery Dialog closes immediately
body: <p>I have a jQuery dialog box that closes immediately upon opening. It is set to a button located in a template field of a GridView.</p>
  
  <p><strong>My JavaScript:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $("#txtBeginDate").datepicker();
          $("#txtEndDate").datepicker();
  
          $("#response").dialog({
              autoOpen: false,
              modal: true,
              title: "Equifax Response"
          });
  
          $("[id*=lnkEquifaxResponse]").live("click", function EquifaxResopnse() {
              $("#response").dialog("open");
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>My relevant GridView markup:</strong></p>
  
  <pre><code>&lt;div id="Gridview"&gt;
      &lt;asp:GridView ID="grClientTransactions" runat="server" AllowPaging="True" 
          PageSize="25" AutoGenerateColumns="False" DataKeyNames="ResponseXML"
          EmptyDataText="Record not found." EmptyDataRowStyle-BackColor="#CCCCCC" 
          EmptyDataRowStyle-Font-Bold="true" CssClass="mGrid" 
          PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
          OnPageIndexChanging="grClientTransactions_PageIndexChanging" 
          onrowcommand="grClientTransactions_RowCommand"&gt;
  
          &lt;Columns&gt;
              &lt;asp:TemplateField ShowHeader="false"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:LinkButton ID="lnkEquifaxResponse" runat="server" 
                          CausesValidation="False"
                          CommandName="EquifaxResponse" 
                          Text="View" 
                          CommandArgument='&lt;%# DataBinder.Eval(Container, "RowIndex") %&gt;'&gt;
                      &lt;/asp:LinkButton&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
              &lt;asp:TemplateField Visible="false" HeaderText="Equifax Response"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="lblEquifaxResponse" runat="server" 
                          Text='&lt;%# Bind("ResponseXML")%&gt;' &gt;
                      &lt;/asp:Label&gt;&lt;/div&gt;                            
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;                          
          &lt;/Columns&gt;
  </code></pre>
  
  <p><strong>My div that displays a label with an assigned string from CodeBehind:</strong></p>
  
  <pre><code>&lt;div id="response"&gt;
      &lt;asp:Label ID="lblDialog" runat="server" &gt;&lt;/asp:Label&gt;
  &lt;/div&gt;
  </code></pre>