Wednesday, March 21, 2012

events calendar with PopupControlExtender

I developed an events calendar in .NET 2.0. When you click on a calendar date, the details for that day are retrieved from a database and displayed in a repeater. I'd like to use the PopupControlExtender to display the details in a popup panel instead. How can I go about assigning the TargetControlID of the PopupControlExtender to work with the Calendar. Thanks in advance for any suggestions.

Jay

Hi Jay,

Based on my experience, the easies way is set PopupControlExtender's TargetControlID to a hidden control. We first Attach a Javascipt function to CalendarExtendar's onselect(add_dateSelectionChanged) event.The Javascript will show the PopupControlExtender and adjust its showing position.

To attach a Javascript to Calendar, we assume that the Calendar is a CalendarExtender.(Since the Calendar is written by you, so you should have easier way).

function pageLoad() { $find("CalendarExtender's BehaviorID").add_dateSelectionChanged("your function name here");}

To adjust the panel's postion, we should use $common.setLocation($get("<%=Popped up Panel's ClientID%>"),new Sys.UI.Point(x , y));

Hope this help.

Best regards,

Jonathan.

No comments:

Post a Comment