[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Calendar Control: Breaks if set to December 9999

Nathan Pickett

2/27/2004 3:59:00 PM

Hi-



The following exception is being throw when I set the ASP.NET Calendar
control to December 1, 9999 (end of time):



Specified argument was out of the range of valid values. Parameter name:
Year, Month, and Day parameters describe an unrepresentable DateTime.



I believe that this is because when the control renders the title, the value
for the navigation's next month is not a valid DateTime since it is greater
than the DateTime.MaxValue (23:59:59.9999999, December 31, 9999).



To resolve this issue I am currently using Regular Expressions to validate
the input for the intial date. If the date is greater than December 9999 ,
I am assigning the Calendar's TodaysDate property to November, 30 9999 in
the Page_Load. I am also doing this check in VisibleMonthChanged event.
This disallows the Calendar to render a view greater than November 9999.



It would make more sense to the user if the next month navigation is disable
or removed from the title navigation for December 9999. Is there a way to
prevent the next month navigation element from rendering if the date is
December 9999? Preferable without extending the Calendar control.



Thanks! -Nate