title: Firing the JQuery Dialog using an ASP.NET Button?
body: <p>I have a Page which has a Control on it with 2 textboxes (username and password) and an asp:Button.  If the user's membership is going to expire within 30 days and the button is clicked, I want the JQuery dialog to popup.  Inside the JQuery dialog, I have some text and an asp:LinkButton.  The link button has an event attached to it, but it is not being fired when I click it in the dialog box.  Here is the script tags for the JQuery:</p>
  
  <pre><code>&lt;script type="text/javascript" src="jquery-1.3.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="ui.core.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="ui.draggable.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="ui.resizable.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="ui.dialog.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Here is the script the dialog: For testing, I am closing the dialog on Renew Membership click, but I actually want it to fire a method I create in asp.net to direct the user to a another page and pass a session variable.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $("#dialog").dialog({
           // autoOpen: false,
              modal: true,
              buttons: { "Renew Membership": function() { $(this).dialog("close"); } }
          });
      });
  &lt;/script&gt;
  
  &lt;asp:Content ID="mainContent" runat="server" ContentPlaceHolderID="Content"&gt;
  &lt;div id="dialog" title="Membership Renewal"&gt;
      &lt;p&gt;Uh Oh! Your membership is going to expire.&lt;/p&gt;&lt;br /&gt;
      &lt;p&gt;Hurry up and renew today!&lt;/p&gt;&lt;br /&gt;
      &lt;asp:LinkButton runat="server" Text="Click Here to Renew" 
          onclick="Unnamed2_Click"&gt;&lt;/asp:LinkButton&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the click event for the LinkButton:</p>
  
  <pre><code>protected void Unnamed2_Click(object sender, EventArgs e)
  {
      UserProfiles userProfile = (UserProfiles)Session["userProfile"];
      Response.Redirect("~/Renew.aspx");
  }
  </code></pre>
  
  <p>What should happen is that when the user clicks the sign-in button, it should popup up the dialog only if the days they have left to expire is &lt;= 30 and if they do, they have the option of clicking the link in the dialog and going to a renew page where I want to pass it a Session variable with a Profile, but that is not being called, so I guess, I would like to know is how can I add the event handler of the button to the dialog and is there a way to set it so that it only comes up once, for example adding a cookie to the users browser and only showing it if they don't have a cookie set.</p>