Hi All ,
Ajax calendor extender Not working on first load .After Postback its working . can anyone suggest with example .
Code
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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sangeetha SRank #212 · 11.4K reputationPosted Apr 10, 2025, 7:42 AM EDT
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 BlakeRank #1,595 · 993 reputationPosted Apr 10, 2025, 4:43 AM EDT
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:
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ScriptManager.RegisterStartupScript(this, GetType(), "LoadCalendarScripts", "Sys.Application.add_load(LoadCalendar);", true); } }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!