Calling a javascript function disables calendar extender
I have a script manager and calendar extender on my aspx page. When I call a javascript function from my code behind page, the calendar extender doesn't work
anymore. I call it like this:
ScriptManager.RegisterStartupScript(Page, this.GetType(), "javascriptfunction", "<script language=javascript>function();</script>", true);
OR
Page.ClientScript.RegisterStartupScript(this.GetType(), "javascriptfunction", "<script language=javascript>function();</script>", true);
Any ideas?
Thank you.
Re: Calling a javascript function disables calendar extender
There may be an error in your JS. Check JS error.
Which version u r using?
Re: Calling a javascript function disables calendar extender
Thanks for your reply. The javascript doesn't seem to error as it accomplishes what it's supposed to. The javascript function in the .aspx page starts as
window.onload = function () {
code here....
}
and them I'm calling it in the gridview databound event:
ScriptManager.RegisterStartupScript(Page, this.GetType(), "javascriptfunction", "<script language=javascript>function();</script>", true);
Re: Calling a javascript function disables calendar extender
You can try using these on page_loadcomplete
CalendarExtender.EnsureValid
CalendarExtender.Databind