Thursday, June 19, 2014

JQueryUI DatePicker doesnt work in UpdatePanel after partial post back?

Heres the solution:
Im showing an alert if no data available, after alert the datepicker stopped working due to partial post, adding EndRequestHandlerfixed the issue.

 <script type="text/javascript">
     $(document).ready(function () {
         Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
 
         function EndRequestHandler(sender, args) {
             
             $('.datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
         }
 
     });
    </script>  

No comments:

Post a Comment