Calendar Control and ASP.Net 2.0

G

Guest

I am using the standard Calendar control in ASP.Net 2.0 and VB.Net and VS2005.

Here is the code:

<asp:calendar id="cldr_contract_date" runat="server" backcolor="#ffffff"
width="250px" height="200px" font-size="12px" font-names="Arial"
borderwidth="2px" bordercolor="#000000" nextprevformat="shortmonth"
daynameformat="firsttwoletters" OnSelectionChanged="cldr_SelectionChanged">
<titlestyle font-size="14px" font-bold="true" borderwidth="2px"
forecolor="#000055" />
<dayheaderstyle font-size="12px" font-bold="true" />
<todaydaystyle backcolor="#D3D3D3" forecolor="#ffffff" />
<selecteddaystyle backcolor="#000000" forecolor="#ffffff" />
<nextprevstyle font-size="12px" font-bold="true" forecolor="#333333" />
<othermonthdaystyle forecolor="#cccccc" />
</asp:calendar>

My question revolves around the ability of the user to select a month or
year that is a long length of time from the default date.

For example, the default date that is displayed on the calendar is today.
The user wants to select a day that is 3 years prior to today.

Right now, it appears that the only way that the user can select that
3-years-prior date is to continually click the previous month link until he
gets to 3 years ago. That is 36 clicks and it is no surprise that the user is
not happy having to do that.

Is there a way to configure the Calendar control to where the user can
select the year (and even month) without so many clicks?

If the answer is no, could anyone recommend another flexible third-party
calendar control that integrates well with VS2005 and VB.Net?

TIA
 
J

jimsurf

I started with the example url from the first reply, and it did som
things great, but the calendar included days from the previous an
next months and the drop down lists did not seem to update correctl
when those days were selected. I am a newbie to .Net, but here i
what I came up with

aspx fil
<table cellpadding="2" cellspacing="0" border="0
align="center"
<tr valign="top"
<td colspan="2" align="left"
<asp:Label ID="lblDate" runat="server" Text="" /
</td
</tr
<tr valign="top"
<td align="left"
<asp:DropDownList ID="drpMonthCal" runat="server
AutoPostBack="True
OnSelectedIndexChanged="drpCalMonth_SelectedIndexChanged
Width="101px" /
</td
<td align="left"
<asp:DropDownList ID="drpYearCal" runat="server
AutoPostBack="True
OnSelectedIndexChanged="drpCalYear_SelectedIndexChanged
Width="104px" /
</td
</tr
<tr valign="top"
<td colspan="2" align="center"
<asp:Calendar ID="calSource" runat="server
BackColor="#FFFFCC
BorderColor="#FFCC66" BorderWidth="1px
DayNameFormat="Shortest
Font-Names="Verdana" Font-Size="8pt
ForeColor="#663399" Height="200px
ShowGridLines="True" Width="220px
OnSelectionChanged="calSource_SelectionChanged"
<SelectedDayStyle BackColor="#FFCC66" /
<TodayDayStyle ForeColor="#CC9966" /
<SelectorStyle BackColor="#FFCC66" /
<OtherMonthDayStyle ForeColor="#CC9966" /
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC
/
<DayHeaderStyle BackColor="#FFCC66
Font-Bold="True" Height="1px" /
<TitleStyle BackColor="#990000" Font-Bold="True
Font-Size="9pt" ForeColor="#FFFFCC" /
</asp:Calendar
</td
</tr
</table

[b:c30d324379].cs file[/b:c30d324379
<%@ Page Language="C#" MasterPageFile="~/Pop/PopMasterPage.master
AutoEventWireup="true" CodeFile="Calendar.aspx.cs
Inherits="Pop_Calendar" Title="Mission Beach Volleyball - Calendar
%
<asp:Content ID="Content1
ContentPlaceHolderID="PopContentPlaceHolder" Runat="Server"
<table cellpadding="2" cellspacing="0" border="0
align="center"
<tr valign="top"
<td colspan="2" align="left"
<asp:Label ID="lblDate" runat="server" Text="" /
</td
</tr
<tr valign="top"
<td align="left"
<asp:DropDownList ID="drpMonthCal" runat="server
AutoPostBack="True
OnSelectedIndexChanged="drpCalMonth_SelectedIndexChanged
Width="101px" /
</td
<td align="left"
<asp:DropDownList ID="drpYearCal" runat="server
AutoPostBack="True
OnSelectedIndexChanged="drpCalYear_SelectedIndexChanged
Width="104px" /
</td
</tr
<tr valign="top"
<td colspan="2" align="center"
<asp:Calendar ID="calSource" runat="server
BackColor="#FFFFCC
BorderColor="#FFCC66" BorderWidth="1px
DayNameFormat="Shortest
Font-Names="Verdana" Font-Size="8pt
ForeColor="#663399" Height="200px
ShowGridLines="True" Width="220px
OnSelectionChanged="calSource_SelectionChanged"
<SelectedDayStyle BackColor="#FFCC66" /
<TodayDayStyle ForeColor="#CC9966" /
<SelectorStyle BackColor="#FFCC66" /
<OtherMonthDayStyle ForeColor="#CC9966" /
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC
/
<DayHeaderStyle BackColor="#FFCC66
Font-Bold="True" Height="1px" /
<TitleStyle BackColor="#990000" Font-Bold="True
Font-Size="9pt" ForeColor="#FFFFCC" /
</asp:Calendar
</td
</tr
</table
</asp:Content

I hope it helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top