Displaying a Selected Range of Dates in the Calendar Control (VB.net)
<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
If Not IsPostBack Then
Dim I as Integer
For i = 0 to 4
MyCal.SelectedDates.Add(DateAdd( _
Microsoft.VisualBasic.DateInterval.Day, _
i, Today()))
Next
End If
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Displaying a Selected Range of Dates in the 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"
selectionmode="DayWeekMonth"
selectorstyle-font-bold="True"
selectorStyle-backcolor="#3366ff"
font-name="Tahoma"
font-size="12"
backcolor="ivory"
selecteddaystyle-backcolor="#ffcc66"
selecteddaystyle-font-bold="True"
/>
</form>
</BODY>
</HTML>
Related examples in the same category