Hi All ,
Ajax calendor extender Not working on first load .After Postback its working . can anyone suggest with example .
Hi All ,
Ajax calendor extender Not working on first load .After Postback its working . can anyone suggest with example .
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sangeetha SPosted Apr 10, 2025, 11:42 AM
your
CalendarExtenderis not initializing properly on the first load. This issue can often be resolved by ensuring that theToolkitScriptManageris used instead of the standardScriptManager.Example
Eliana BlakePosted Apr 10, 2025, 8:43 AM
It appears that the issue you are encountering with your Ajax calendar extender not working on the first load but functioning after a postback is a common scenario. This behavior could be due to the way the page lifecycle events interact with the extender control.
One potential solution to address this issue is to ensure that the script resources required by the Ajax calendar extender are properly loaded and initialized on the initial page load. You can achieve this by explicitly registering the script dependencies in the code-behind of your page.
Here's an example of how you can register the necessary script resources for the Ajax calendar extender in the Page_Load event handler of your code-behind file:
In this code snippet, we are using the ScriptManager.RegisterStartupScript method to register a startup script that will load the calendar extender scripts after the page has loaded. The LoadCalendar function can then be implemented in a separate script block on your page to initialize the calendar extender.
By ensuring that the necessary scripts are loaded and initialized correctly on the initial page load, you should be able to resolve the issue of the Ajax calendar extender not working until after a postback.
I hope this explanation and example provide some insights into resolving the issue you are facing with the Ajax calendar extender. If you have any more questions or need further assistance, feel free to ask!