title: how to get javascript to execute in update panel
body: <p>I have an update panel which contains a table, to which I add rows of controls on a button click.  One of the controls that is added, is a user control and it is a datepicker.  Inside of that user control I have a textbox, and I have JQuery which applies the JQuery UI DatePicker plugin to it thereby turning it into a datepicker.  It's not a problem if that user control is loaded onto a page dynamically, however, if it is done on async postbacks inside an update panel, the javascript doesn't fire and therefore the textbox is render but without all the jquery datepicker functionality.  Here's some code that's inside the DatePicker.ascx:</p>
  
  <pre><code>$(function() {
         //reset the localization
          $.datepicker.setDefaults($.extend($.datepicker.regional['']));
          $("#&lt;%=txtDate.ClientID%&gt;").datepicker({ dateFormat: 'mm/dd/yy', showOn: 'button', buttonImage: '/images/calendar.gif', buttonImageOnly: true, altField: '#&lt;%=txtDate.ClientID%&gt;' });
  </code></pre>
  
  <p>}</p>
  
  <p>So this jquery isn't fired when the control is loaded in dynamically on an async postback.  So how can I make this work?</p>