1

Is it possible to use the ASP.Net Range validator when the format string is dd/MMM/yyyy?

4

3 回答 3

2

Why don't you use Regular Expression validator?

于 2008-12-29T12:59:01.740 回答
0

No. I think it should be a valid date (without the formatting)

于 2008-12-29T11:17:51.133 回答
0

ASP.net auto detects the culture info of the client. This info is used to resolve formatting like dates, currency etc.

You can override this with code (something like):

Thread.CurrentThread.CurrentCulture = 
    CultureInfo.CreateSpecificCulture("en-GB");
Thread.CurrentThread.CurrentUICulture =
    new CultureInfo("en-GB");

Or globally in the web.config:

<globalization requestEncoding="utf-8" responseEncoding="utf-8"
    culture="en-GB" uiCulture="en-GB" />

Of course this could have negative/positive side effects on the rest of your application, as it would affect other numbers/dates, but perhaps this is your intent anyway.

于 2008-12-29T13:09:02.297 回答