Thursday, 13 March 2014

Calender in Updatepanel

Please replace the following code
----------------------------------------
<script type="text/javascript">
               $(function () {
                   $('.txtdate').datepicker(
                        {
                            dateFormat: "dd-mm-yy",
                            changeMonth: true,
                            changeYear: true
                        });
               });
    </script>

By
---
 <script type="text/javascript">

        function pageLoad(sender, args) {          
            cal_date()
        }

        function cal_date() {
            $('.txtdate').unbind();           
            jQuery(document).ready(function ($) {
                $('.txtdate').datepicker({
                    dateFormat: "dd-mm-yy",
                    autoSize: true,
                    changeMonth: true,
                    changeYear: true
                });
            });
        }
    </script>

No comments:

Post a Comment