Groups | Blog | Home
all groups > asp.net > november 2004 >

asp.net : RangeValidator Minimum Date can not be 01.01.0001


Chris R. Timmons
11/22/2004 7:48:35 PM
"Johannes Hammersen" <Johannes.Hammersen@x75.net> wrote in
news:ei2SGNO0EHA.2804@TK2MSFTNGP15.phx.gbl:

[quoted text, click to view]

Johannes,

From the help file for RangeValidator.MaximumValue:

"Note If you specify ValidationDataType.Date for the
BaseCompareValidator.Type property without programmatically setting
the culture for the application, you should use a culture-neutral
format, such as YYYY/MM/DD, for the MaximumValue and MinimumValue
properties. Otherwise, the date may not be interpreted correctly."

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
Johannes Hammersen
11/22/2004 11:37:29 PM
Hi,
when I try to set the Minimum Date on a RangeValidator to 01.01.0001 I get
an error, that 01.01.0001 can not be converted to a date.
But the DateType can be 01.01.0001. Convert.ToDateTime("01.01.0001") works.
So why can't I set the Minimum of the RangeValidator to that Date?

I have the same Problem with the Maximun Value. If I try to set that let's
say to the 31th December 9999 it will give me an error.

You can reproduce this error if you put an RangeValidator on a WebForm, set
it's type to Date an put 01.01.0001 as minimum value.

What am I doing wrong? Or is this a bug, and if yes does anyone know a
workaround?

Thanks for any help
Johannes Hammersen

Johannes Hammersen
11/23/2004 1:55:23 PM
Ah,

thanks that helps!
I thought I would just use the maschines settings like convert.to does.

Thank you
Johannes

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> schrieb im
Newsbeitrag news:Xns95A9DE833747Dcrtimmonscrtimmonsin@207.46.248.16...
[quoted text, click to view]

AddThis Social Bookmark Button