Update panel with a .net Calendar control having issues with asynctriggers & VisibleMonthChanged event

StackOverflow https://stackoverflow.com/questions/22162092

  •  19-10-2022
  •  | 


I've got the following update panel wrapping around a Calendar control in .net

<asp:UpdatePanel runat="server" ID="CalendarPanel" UpdateMode="conditional">
        <asp:Calendar ID="ClubCalendar" runat="server" Width="800" height="500"  DayHeaderStyle-CssClass="dateDayItem"/>
        <asp:AsyncPostBackTrigger ControlID="ClubCalendar" EventName="SelectionChanged" />
        <asp:AsyncPostBackTrigger ControlID="ClubCalendar" EventName="VisibleMonthChanged" />

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

No correct solution


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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top