I've got the following update panel wrapping around a Calendar control in .net
<asp:UpdatePanel runat="server" ID="CalendarPanel" UpdateMode="conditional">
<ContentTemplate>
<asp:Calendar ID="ClubCalendar" runat="server" Width="800" height="500" DayHeaderStyle-CssClass="dateDayItem"/>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ClubCalendar" EventName="SelectionChanged" />
<asp:AsyncPostBackTrigger ControlID="ClubCalendar" EventName="VisibleMonthChanged" />
</Triggers>
</asp:UpdatePanel>
My issue is with the VisibleMonthChanged
event
I get the following error when loading the page
The 'VisibleMonthChanged' event on associated control 'ClubCalendar' for the trigger in UpdatePanel 'CalendarPanel' does not match the standard event handler signature.
Any help with this would be greatly appreciated
While I still don't know if its possible to setup the trigger for the VisibleMonthChanged
event I was able to work around this by setting up the event in the code behind
ClubCalendar.VisibleMonthChanged +=new MonthChangedEventHandler(ClubCalendar_VisibleMonthChanged);
and then calling the Panel update method manually.
void ClubCalendar_VisibleMonthChanged(Object sender, MonthChangedEventArgs e)
{
StartDate = e.NewDate;
CalendarPanel.Update();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.