Wednesday, March 21, 2012

CalendarExtender onclick?

When you click on a date in the ajaxToolkit's Calendar Extender, the calendar doesn't disappear. What can I do so that it disappears on clicking a date?

to close the calendar onClick i set this up in the code behind

//Hide the calendarprotected override void OnLoad(EventArgs e) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"hideCalendar", @."function hideCalendar(cb) { cb.hide(); }",true);base.OnLoad(e); }

and this is what the asp code looks like

 <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate" OnClientDateSelectionChanged='hideCalendar'>

Great, I had the same issue.

Actually I noticed that you don't need to have any code behind, you can simply put:

OnClientDateSelectionChanged="function hideCalendar(cb) { cb.hide(); }"

And it will work. Works even if you have more than one extender.


Thanks a lot guys! You saved a life today!


Hello..!

Is there anyone who can help me...! Please. I have created a web page with master page then i inserted CalendarExtender in the web page but in running mode when i click on the related textbox it doesnt show the calendar... I dont know why?...
note: i inserted script manager in master page......

So, What is the possible solution..???

Thanks, Waseem


I just had problems with the calendar extender myself so I think i can help... but u'll have to show us what you have already!

No comments:

Post a Comment