title: Load Jquery after async ajax update in asp.net
body: <p>I have a ASP.net page that is jquery heavy.</p>
  
  <p>on this page I have a gridview inside a updatepanel so I can make a asynch update.
      <br>
            </p>
  
  <pre><code>&lt;asp:GridView ID="gvMail" runat="server" GridLines="None" 
  AutoGenerateColumns="false" Width="100%" OnRowDataBound="mail_RowDataBound"
  CssClass="gridview" DataKeyNames="id"&gt;
  
  
  &lt;HeaderStyle HorizontalAlign="Left" /&gt;
  &lt;RowStyle ForeColor="#0072BC" HorizontalAlign="Left" CssClass="draggable" /&gt;
  
  &lt;/asp:GridView&gt;
  
  &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  
  &lt;!-- Hidden Link button for Async call back --&gt;
  &lt;asp:UpdatePanel ID="updatePanel2" runat="server"&gt;
  &lt;ContentTemplate&gt;
  &lt;asp:LinkButton ID="btnLoadData" onclick="btnLoadData_Click" runat="server" 
   Text="Fill GridView" CssClass="none"&gt;&lt;/asp:LinkButton&gt; &lt;!-- hidden--&gt;
  
  &lt;a href="javascript: AsyncUpdateGridView()"&gt;A sync update&lt;/a&gt;
  &lt;!-- testing purposes only--&gt;
  
  &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>so with this little hack i click hte linkbutton to update the gridview which works fine. Eventually the AsyncUpdateGridView() which just calles the _dopostback method of the hidden linkbutton will be in Javascript.</p>
  
  <p>The problem I have, is my GridView has columns which are Jquery DatePickers and Jquery fancy Drop Down Box's. They are loaded with this javascript call:</p>
  
  <pre><code>  function OnLoadPage() {
              $(".jqueryselector").selectbox({
                  effect: "fade"
              });
  
              $(".jquerydatepicker").datepicker({ dateFormat: 'dd-mm-yy' });
          }
  
          $(document).ready(function () {
              OnLoadPage();
          }
  </code></pre>
  
  <p>The reason I made the OnLoadPage() function was because I tried calling that after I did the _DoPostBack call after the update.</p>
  
  <p>However this doesnt work. So now when the page fist loads, all the jquery datepicker, drop down boxs and other fancy things I have work in the GridView. But after the asynch Callback it reloads with all the default html.</p>