<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub calSelectChange(ByVal Sender as Object, ByVal E as EventArgs)
lblMessage.Text = "You selected " _
& MyCal.SelectedDate
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Writing Code that Fires when a Date is Selected 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"
onselectionchanged="calSelectChange"
/>
<BR><BR>
<asp:Label
id="lblMessage"
runat="server"
Font-Bold="True"
/>
</form>
</BODY>
</HTML>
|