[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: Exception with December 9999 Date

Nathan Pickett

2/27/2004 7:36: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?



5 Answers

Ken Cox [MS MVP]

2/28/2004 8:13:00 PM

0

Why not just trap for a datetime within the allowable range and be done with
it?

I wouldn't spend a lot of time on a problem that is several millenia away.

Ken

"Nathan Pickett" <npickett@cps92.com> wrote in message
news:OiKvpjW$DHA.916@TK2MSFTNGP10.phx.gbl...
> 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?
>
>
>

halong

9/8/2010 2:27:00 AM

0

On Sep 7, 9:19 pm, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
> On Sep 7, 10:06 pm, "[2Le]" <sir...@gmail.com> wrote:
>
> > On Sep 8, 9:46 am, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
> > > Th?y Pooh De BeHe h?i :
>
> > > Trong m?t l?p h?c, th?y h?i : " T? nh?ng con s? 0,1,2,3,4,5,6,7, em
> > > nào có th? thêm các t? vào d? ghép v?i các s? này thành câu có nghia
> > > không ? "
>
> > > :-)))))
>
> > Theo -die^`u khoa?n 01 cu?a nghi. -di.nh 23 thi` LeDouxSatan bi.
> > pha.t 45 nga`y tro.ng ca^'m co^.ng the^m 67 ca'i hi't -da^'t ... hehe
>
> Cu~ng ddu'ng, nhu+ng thu+? the^m va`o theo tu+`ng con so^' 7, 6, 5, 4,
> 3, 2, 1, 0 :-)))
>
> Se~ tha^'y ddu'ng kie^?u cho+i cua? Mr. Pooh :-)))
>
> Thanks :-)))

Nga`y 7 thang 6 nam canh dan, xe tang T 54 tien vo duong 3-2 o+? thanh
ho thu.t 1 trai' 0 tru'ng ai het

heheheh

LeDouxSatan

9/8/2010 2:42:00 AM

0

On Sep 7, 10:26 pm, halong <cco...@netscape.net> wrote:
> On Sep 7, 9:19 pm, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
>
>
>
>
> > On Sep 7, 10:06 pm, "[2Le]" <sir...@gmail.com> wrote:
>
> > > On Sep 8, 9:46 am, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
> > > > Th?y Pooh De BeHe h?i :
>
> > > > Trong m?t l?p h?c, th?y h?i : " T? nh?ng con s? 0,1,2,3,4,5,6,7, em
> > > > nào có th? thêm các t? vào d? ghép v?i các s? này thành câu có nghia
> > > > không ? "
>
> > > > :-)))))
>
> > > Theo -die^`u khoa?n 01 cu?a nghi. -di.nh 23 thi` LeDouxSatan bi.
> > > pha.t 45 nga`y tro.ng ca^'m co^.ng the^m 67 ca'i hi't -da^'t ... hehe
>
> > Cu~ng ddu'ng, nhu+ng thu+? the^m va`o theo tu+`ng con so^' 7, 6, 5, 4,
> > 3, 2, 1, 0 :-)))
>
> > Se~ tha^'y ddu'ng kie^?u cho+i cua? Mr. Pooh :-)))
>
> > Thanks :-)))
>
> Nga`y 7 thang 6 nam canh dan, xe tang T 54 tien vo duong 3-2 o+? thanh
> ho thu.t 1 trai' 0 tru'ng ai het
>
> heheheh- Hide quoted text -
>
> - Show quoted text -

Cu~ng ddu'ng, nhu+ng ha~y theo tu+`ng con so^': 7, 6, 5, 4, 3, 2, 1,
0 :-))))
Se~ tha^'y ddu'ng kie^?u cho+i nha` nghe^` cua? Mr. Pooh Po^ La
Ta('c :-)))

Thanks :-)))

[2Le]

9/8/2010 3:23:00 AM

0

On Sep 8, 10:41 am, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
> On Sep 7, 10:26 pm, halong <cco...@netscape.net> wrote:
>
>
>
>
>
> > On Sep 7, 9:19 pm, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
> > > On Sep 7, 10:06 pm, "[2Le]" <sir...@gmail.com> wrote:
>
> > > > On Sep 8, 9:46 am, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
> > > > > Th?y Pooh De BeHe h?i :
>
> > > > > Trong m?t l?p h?c, th?y h?i : " T? nh?ng con s? 0,1,2,3,4,5,6,7, em
> > > > > nào có th? thêm các t? vào d? ghép v?i các s? này thành câu có nghia
> > > > > không ? "
>
> > > > > :-)))))
>
> > > > Theo -die^`u khoa?n 01 cu?a nghi. -di.nh 23 thi` LeDouxSatan bi.
> > > > pha.t 45 nga`y tro.ng ca^'m co^.ng the^m 67 ca'i hi't -da^'t ... hehe
>
> > > Cu~ng ddu'ng, nhu+ng thu+? the^m va`o theo tu+`ng con so^' 7, 6, 5, 4,
> > > 3, 2, 1, 0 :-)))
>
> > > Se~ tha^'y ddu'ng kie^?u cho+i cua? Mr. Pooh :-)))
>
> > > Thanks :-)))
>
> > Nga`y 7 thang 6 nam canh dan, xe tang T 54 tien vo duong 3-2 o+? thanh
> > ho thu.t 1 trai' 0 tru'ng ai het
>
> > heheheh-
>
>
> Cu~ng ddu'ng, nhu+ng ha~y theo tu+`ng con so^': 7, 6, 5, 4, 3, 2, 1,
> 0 :-))))
> Se~ tha^'y ddu'ng kie^?u cho+i nha` nghe^` cua? Mr. Pooh Po^ La
> Ta('c :-)))
>
> Thanks :-)))

Chuo*ng tri`nh lu'c 0 gio*` pha't hi`nh 1 gio*` sa'ng tre^n ke^nh 2
-da`i ABC3 nga`y thu*' 4 mu`ng 5 tha'ng 6 la`m 7 nguo*`i -du*'ng tim
ta('t tho*? :-)))

LeDouxSatan

9/9/2010 1:23:00 AM

0

On Sep 7, 11:23 pm, "[2Le]" <sir...@gmail.com> wrote:
> On Sep 8, 10:41 am, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
>
>
>
>
> > On Sep 7, 10:26 pm, halong <cco...@netscape.net> wrote:
>
> > > On Sep 7, 9:19 pm, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
> > > > On Sep 7, 10:06 pm, "[2Le]" <sir...@gmail.com> wrote:
>
> > > > > On Sep 8, 9:46 am, LeDouxSatan <laplussympathi...@yahoo.fr> wrote:
>
> > > > > > Th?y Pooh De BeHe h?i :
>
> > > > > > Trong m?t l?p h?c, th?y h?i : " T? nh?ng con s? 0,1,2,3,4,5,6,7, em
> > > > > > nào có th? thêm các t? vào d? ghép v?i các s? này thành câu có nghia
> > > > > > không ? "
>
> > > > > > :-)))))
>
> > > > > Theo -die^`u khoa?n 01 cu?a nghi. -di.nh 23 thi` LeDouxSatan bi.
> > > > > pha.t 45 nga`y tro.ng ca^'m co^.ng the^m 67 ca'i hi't -da^'t ... hehe
>
> > > > Cu~ng ddu'ng, nhu+ng thu+? the^m va`o theo tu+`ng con so^' 7, 6, 5, 4,
> > > > 3, 2, 1, 0 :-)))
>
> > > > Se~ tha^'y ddu'ng kie^?u cho+i cua? Mr. Pooh :-)))
>
> > > > Thanks :-)))
>
> > > Nga`y 7 thang 6 nam canh dan, xe tang T 54 tien vo duong 3-2 o+? thanh
> > > ho thu.t 1 trai' 0 tru'ng ai het
>
> > > heheheh-
>
> > Cu~ng ddu'ng, nhu+ng ha~y theo tu+`ng con so^': 7, 6, 5, 4, 3, 2, 1,
> > 0 :-))))
> > Se~ tha^'y ddu'ng kie^?u cho+i nha` nghe^` cua? Mr. Pooh Po^ La
> > Ta('c :-)))
>
> > Thanks :-)))
>
> Chuo*ng tri`nh lu'c 0 gio*` pha't hi`nh 1 gio*` sa'ng tre^n ke^nh 2
> -da`i ABC3 nga`y thu*' 4 mu`ng 5 tha'ng 6 la`m 7 nguo*`i -du*'ng tim
> ta('t tho*? :-)))- Hide quoted text -
>
> - Show quoted text -

Cu~ng ddu'ng la('m :-)))

Nhu+ng tha`y Pooh gia?ng ra(`ng:

" Tha`y Pooh va` tro`, ca~ hai di du l?ch 7 ngày, 6 dêm, ? khách s?n 5
sao, t?ng th? 4, phòng s? 3, g?m 2 ngu?i & ch? 1 giu?ng và 0 ai
có .... :-)))))

:-)))))