0

I have a custom control which contains a jquery datepicker and initializing it in $(document).ready() function.

I am using this datepicker custom control in aspx page two times(start date and end date) which are placed inside update panel. This is working fine when the page loads for the first time and disappers when the postback happens.

I tried initializing datepicker in function pageLoad() instead of $(document).ready() but the problem with this approach is only end date datepicker is visible but not start date when the page loads for the first time or when the postback happens.

I tried other solutions but they are not working for this case. Here are few of solutions I tried link1 , link2 , link3 Please help.

Community
  • 1
  • 1
Sandeep Kushwah
  • 590
  • 1
  • 18
  • 35

1 Answers1

0

try this

function pageLoad(sender, args) {
            if (args.get_isPartialLoad()) {
                $(function () {
                    //place Your datepicker code -- $("controlId").datepicker();
                });
            }
        }
Amit Mishra
  • 285
  • 2
  • 5
  • 17
  • sorry for delayed reply. as I mentioned earlier if we initialize calendar inside function pageLoad{ }, only last datepicker will be displayed in UI – Sandeep Kushwah Nov 28 '16 at 06:46