title: How to call jquery dialog on gridview button click?
body: <p>I am using <a href="http://jqueryui.com/dialog/#modal-form" rel="nofollow">jquerydialog</a>.I have a gridview and an edit button in it.I want to call the <code>jquery dialog</code> on gridview edit buttons <code>click event</code> and .How can i achieve this?JqueryDialog is working properly on a button click event when is placed outside the gridview</p>
  
  <p>Here the javascript </p>
  
  <pre><code>&lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt; 
     $(function() {    
          $("#dialog-form").dialog({
              autoOpen:false,
              show:{
                  effect:"blind",
                  duration:1000                
              },
              hide:{
                  effect:"explode",
                  duration:1000
              },
              height:500,
              width:550,
              modal:true              
          });            
     });
     $("input[id$=btnAdd]").live("click",function(){                
              $("#dialog-form").dialog("open");
          });
   &lt;/script&gt;
  </code></pre>
  
  <p>Heres the gridview i have used</p>
  
  <pre><code>&lt;asp:GridView ID="gdProgram" runat="server" CssClass="ui-widget ui-widget-contain" AutoGenerateColumns="False" Width="700px"
  HeaderStyle-CssClass="ui-widget-header"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField HeaderText="SlNo"&gt;
              &lt;ItemTemplate &gt;
                  &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# "Test1" %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
               &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lbl2" runat="server" Text='&lt;%# "Test2" %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;           
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lbl3" runat="server" Text='&lt;%# "Test3" %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;input type="button" id="btnEdit" runat="server" value="Edit" /&gt; 
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;     
  &lt;/asp:GridView&gt;
  </code></pre>