注: イベントを alert、confirm、またはその他の動作で中断しないでください。デフォルトの順序、フォーカス、またはブラウザーのその他のイベントのタイミングを損なう可能性があります。
WebDatePicker1.MinValue = new DateTime(2000, 1, 1) WebDatePicker1.MaxValue = new DateTime(2015, 12, 31) WebDatePicker1.ClientSideEvents.CalendarOpened = "WebDatePicker_CalendarOpened"
WebDatePicker1.MinValue = new DateTime(2000, 1, 1); WebDatePicker1.MaxValue = new DateTime(2015, 12, 31); WebDatePicker1.ClientSideEvents.CalendarOpened = "WebDatePicker_CalendarOpened";
// The client event 'CalendarOpened' takes two parameters sender and e // sender is the object which is raising the event // e is the EventArgs function WebDatePicker_CalendarOpened(sender, e) { //Gets the reference of the WebDatePicker var datePicker = $find("WebDatePicker1"); //Gets the minimum value set on the WebDatePicker var minValue = datePicker.get_minValue(); //Gets the maximum value set on the WebDatePicker var maxValue = datePicker.get_maxValue(); alert("Please select a date between '" + minValue + "' and '" + maxValue + "'."); }