Question: I have a jquery ui datepicker textbox within an update panel. For some reason I can no longer click on it to load the datepicker. This is what I have.

```
// Datepicker settings
$('body').on('load', '#dpWorkWeek', function() {
    $(this).datepicker({
        changeMonth: true,
        changeYear: true,
    });
});

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
      <asp:TextBox ID="dpWorkWeek" runat="server" ClientIDMode="Static" CssClass="dpWorkWeek"></asp:TextBox>

 </ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnLoadTimesheet" />
</Triggers>

```

Answer: 
I think what you are experiencing is that your date picker no longer works after an async postback. If this is the case here is one way of solving it -

```
window.onload = function () {
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);
}

function endRequestHandler(sender, args) {
    init();
}

function init() {
    $("#<%=dpWorkWeek.ClientID %>").datepicker({
        changeMonth: true,
        changeYear: true
    });
}

$(function() { // DOM ready
    init();
});

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
      <asp:TextBox ID="dpWorkWeek" runat="server" CssClass="dpWorkWeek"></asp:TextBox>
 </ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnLoadTimesheet" />
</Triggers>

```

This approach uses the [Sys.WebForms.PageRequestManager JavaScript class](http://msdn.microsoft.com/en-us/library/bb311028.ASPX) and is possible because you have a [Script Manager](http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.aspx) on your .aspx page. Basically after every async postback the init() function will be called.

Notice the init() function is also called in DOM ready. This allows you to do everything to the DOM you need done again after content has changed during the async postback.

I also removed your `ClientIdMode` attribute, I think this will cause issues otherwise.

/edit

After seeing the answer below you can certainly do this too, I like it for brevity - 

```
function pageLoad(sender, args) {
    $("#<%=dpWorkWeek.ClientID %>").datepicker({
        changeMonth: true,
        changeYear: true
    });
}

```

And if that doesn't work this should always -

```
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function(sender, args) {
 // ...
});

```
This is working in my code please follow this code. 

```
( Company : Infotrack Telematics private limited )
<script type="text/javascript">
        $(document).ready(function () {

                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);

        });

        function endRequestHandler(sender, args) {
            init();
        }

        function init() {
            var txtTripStartTime = '#<%=txtNotavlFrom.ClientID %>';
                $('#<%=txtNotavlFrom.ClientID %>').datepicker({
                    dateFormat: 'dd/mm/yy',
                    minDate: 0,
                    beforeShow: function () {
                        $(".ui-datepicker").css('font-size', 10)
                    },
                    onSelect: function (selected) {
                        $('#<%=txtnotavlTo.ClientID %>').datepicker("option", "minDate", selected)

        }

    });
        var txtTripEndTime = '#<%=txtnotavlTo.ClientID %>';
                $('#<%=txtnotavlTo.ClientID %>').datepicker({

                    dateFormat: 'dd/mm/yy',
                    minDate: 0,
                    beforeShow: function () {
                        $(".ui-datepicker").css('font-size', 10)
                    }

                });
            }

```