<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub calMonthChange(ByVal source As Object, _
ByVal e As MonthChangedEventArgs)
lblMessage.Text = "<BR>You changed from month " _
& e.PreviousDate.Month & " and year " _
& e.PreviousDate.Year & " to month " _
& e.NewDate.Month & " and year " _
& e.NewDate.Year
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Writing Code that Fires when the Month Changes in a Calendar Control</TITLE>
</HEAD>
<BODY LEFTMARGIN="40">
<form runat="server">
Select a Date
<BR><BR>
<asp:Calendar
id="Mycal"
runat="server"
cellpadding="3"
cellspacing="3"
onvisiblemonthchanged="calMonthChange"
/>
<BR><BR>
<asp:Label
id="lblMessage"
runat="server"
Font-Bold="True"
/>
</form>
</BODY>
</HTML>
|