簡體   English   中英

帶有.net日歷控件的更新面板出現異步觸發器和VisibleMonthChanged事件問題

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

我有以下更新面板,圍繞.net中的Calendar控件進行了包裝

<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>

我的問題是VisibleMonthChanged事件

加載頁面時出現以下錯誤

 The 'VisibleMonthChanged' event on associated control 'ClubCalendar' for the trigger in UpdatePanel 'CalendarPanel' does not match the standard event handler signature.

任何幫助,將不勝感激

雖然我仍然不知道是否可以為VisibleMonthChanged事件設置觸發器,但我可以通過在后面的代碼中設置事件來解決此問題

 ClubCalendar.VisibleMonthChanged +=new MonthChangedEventHandler(ClubCalendar_VisibleMonthChanged);

然后手動調用Panel更新方法。

void ClubCalendar_VisibleMonthChanged(Object sender, MonthChangedEventArgs e)
    {
        StartDate = e.NewDate;
        CalendarPanel.Update();
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM