リスト選択の更新動作はキャンセルできます。
注: イベントを alert、confirm、またはその他の動作で中断しないでください。デフォルトの順序、フォーカス、またはブラウザーのその他のイベントのタイミングを損なう可能性があります。
WebMonthCalendar1.ClientEvents.ListClosed = "WebMonthCalendar1_ListClosed"
WebMonthCalendar1.ClientEvents.ListClosed = "WebMonthCalendar1_ListClosed";
// The client event 'ListClosed' takes two parameters sender and e // sender is the object which is raising the event // e is the CalendarListCloseEventArgs function WebMonthCalendar1_ListClosed(sender, e) { //Gets the selected value from the list var selectedValue = e.get_selectedValue(); //Gets the id of the list; 1 – list of Months , 2 – list of Years, 3 – list of Decades. var id = e.get_id(); switch (id) { case 1: if (selectedValue != -1) { if (!confirm("Are you sure you want to select the month as '" + selectedValue + "'?")) //Cancels the event and unselects any value if selected. e.set_cancel(true); break; } case 2: if (selectedValue != -1) { if (!confirm("Are you sure you want to select the Year as '" + selectedValue + "'?")) //Cancels the event and unselects any value if selected. e.set_cancel(true); break; } case 3: if (selectedValue != -1) { if (!confirm("Are you sure you want to select the Decade as '" + selectedValue + "'?")) //Cancels the event and unselects any value if selected. e.set_cancel(true); } } }