NET1.1:RangeValidator不适用于匈牙利语DateTime [英] NET1.1: RangeValidator doesn't work with Hungarian DateTime

查看:51
本文介绍了NET1.1:RangeValidator不适用于匈牙利语DateTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在一个开发国际网站的团队工作。当我将

页面的CultureInfo设置为匈牙利语(hu-HU)时,RangeValidator似乎没有

能够解析TextBox''日期值(异常消息见下文)

正确。


TextBox的值来自DateTime.Now.ToShortDateString()

函数,所以它是一个原始的.NET值。


有人可以帮我解决这个问题吗?我需要能够运行这个

的应用程序,直到本周结束。


TIA,

Axel Dahmen


------------------------------

价值'' 2006年。 07. 11.''rngDate'的MaximumValue属性'''不能将
转换为''Date''类型。


异常详情: System.Web.HttpException:值''2006。 '。''
''rngDate''的MaximumValue属性无法转换为''Date''类型。


堆栈跟踪:


[HttpException(0x80004005):值''2006。 。rngDate'的MaximumValue

属性的'。''无法转换为''Date''类型。]

System.Web.UI。 WebControls.RangeValidator.ControlPr opertiesValid()

System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()

System.Web.UI.WebControls.BaseValidator.Render( Htm lTextWriter writer)

System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)

System.Web.UI.Control.Render(HtmlTextWriter writer)

...

解决方案

您好Axel,


您确定2006 / 07.11的日期是否允许在月和日之前有
空格?


问候,

弗兰克





我我在一个开发国际网站的团队中工作。当我将

页面的CultureInfo设置为匈牙利语(hu-HU)时,RangeValidator似乎没有

能够解析TextBox''日期值(异常消息见下文)

正确。


TextBox的值来自DateTime.Now.ToShortDateString()

函数,所以它是一个原始的.NET值。


有人可以帮我解决这个问题吗?我需要能够运行这个

的应用程序,直到本周结束。


TIA,

Axel Dahmen


------------------------------

价值'' 2006年。 07. 11.''rngDate'的MaximumValue属性'''不能将
转换为''Date''类型。


异常详情: System.Web.HttpException:值''2006。 '。''
''rngDate''的MaximumValue属性无法转换为''Date''类型。


堆栈跟踪:


[HttpException(0x80004005):值''2006。 。rngDate'的MaximumValue

属性的'。''无法转换为''Date''类型。]

System.Web.UI。 WebControls.RangeValidator.ControlPr opertiesValid()

System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()

System.Web.UI.WebControls.BaseValidator.Render( Htm lTextWriter writer)

System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)

System.Web.UI.Control.Render(HtmlTextWriter writer)

...


< blockquote>好吧,我想是的,


这个值来自.NET,所以它应该没问题。它适用于我们迄今为止实施的所有其他语言(例如:de,en,fr,nl,cz)......


这是代码:


public DateTime MaximumDate

{

get {return Convert.ToDateTime(rngDate.MaximumValue);}

set {rngDate.MaximumValue = value.ToShortDateString();} //< --- *****

}


TIA,

Axel


----------------

Frank Lehmann < f。****** @ chat4world.com写在留言中

新闻:uL ************** @ TK2MSFTNGP03.phx.gbl ...


您好Axel,


您确定2006.07.11的日期是否允许
$ b月和日之前$ b空格?


问候,

Frank

$ b $


我正在一个开发国际网站的团队工作。当我设置





page'的文化信息到匈牙利语(hu-HU)然后RangeValidator没有



似乎


能够解析TextBox的日期值(异常消息见下文)

正确。


TextBox的值来自DateTime.Now.ToShortDateString()

函数,因此它是一个原始的.NET值。


有人可以帮我解决这个问题吗?我需要能够运行这个

的应用程序,直到本周结束。


TIA,

Axel Dahmen


------------------------------

价值'' 2006年。 07. 11.''''''''''''''''''$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ blockquote class =post_quotes>
转换为类型''Date''。


异常详情:System.Web.HttpException:值''2006。 07. 11.''





''rngDate''的MaximumValue属性无法转换为
类型



''日期''。



堆栈追踪:


[HttpException(0x80004005):价值''2006。 07. 11.'$ $ $ b



MaximumValue

$ ''rngDate''的b $ b属性无法转换为''Date''类型。]

System.Web.UI.WebControls.RangeValidator.ControlPr opertiesValid()

System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()

System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)

系统。 Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)

System.Web.UI.Control.Render (HtmlTextWriter作家)

...



Hi Axel,


我有点猜测,因为我是其他一切,只是使用专家

CultureInfo:

可能与区域设置控制面板

以便Windows本身不是匈牙利语和Windows日期格式覆盖

CultureInfo?


问候,

弗兰克


嗯,我想是的,


的价值是来自.NET所以它应该没问题。它适用于我们迄今为止实施的所有其他语言(例如:de,en,fr,nl,cz)......


这是代码:


public DateTime MaximumDate

{

get {return Convert.ToDateTime(rngDate.MaximumValue);}

set {rngDate.MaximumValue = value.ToShortDateString();} //< --- *****

}


TIA,

Axel


----------------

Frank Lehmann < f。****** @ chat4world.com写在留言中

新闻:uL ************** @ TK2MSFTNGP03.phx.gbl ...


您好Axel,


您确定2006.07.11的日期是否允许
$ b月和日之前$ b空格?


问候,

Frank

$ b $

>

我在一个开发国际网站的团队工作。当我设置





page'的文化信息到匈牙利语(hu-HU)然后RangeValidator没有



似乎


能够解析TextBox的日期值(异常消息见下文)

正确。

>

TextBox的值来自DateTime.Now.ToShortDateString()

函数,因此它是一个原始的.NET值。

>

有人可以帮我解决这个问题吗?我需要能够运行这个

的应用程序,直到一周结束。

>

TIA,

Axel Dahmen

>

---------------------------- -

价值''2006。 07. 11.''''''''''''''''''$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ blockquote class =post_quotes>
转换为''Date''类型。

>

异常详情:System.Web.HttpException:值'' 2006年。 07. 11.''





''rngDate''的MaximumValue属性无法转换为
类型



''日期''。


>

Stack Trace:

>

[HttpException(0x80004005):值''2006。 07. 11.'$ $ $ b



MaximumValue

$ ''rngDate''的b $ b属性无法转换为''Date''类型。]

System.Web.UI.WebControls.RangeValidator.ControlPr opertiesValid()

System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()

System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)

系统。 Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)

System.Web.UI.Control.Render (HtmlTextWriter作家)

...

>

>



Hi,

I''m working in a team developing an international website. When I set the
page''s CultureInfo to Hungarian (hu-HU) then the RangeValidator doesn''t seem
to be able to parse a TextBox''s date value (Exception message see below)
correctly.

The TextBox''s value is coming from the DateTime.Now.ToShortDateString()
function, so it''s an original .NET value.

Can someone please help me out on this? I need to be able to get this
application running until end of the week.

TIA,
Axel Dahmen

------------------------------
The value ''2006. 07. 11.'' of the MaximumValue property of ''rngDate'' cannot
be converted to type ''Date''.

Exception Details: System.Web.HttpException: The value ''2006. 07. 11.'' of
the MaximumValue property of ''rngDate'' cannot be converted to type ''Date''.

Stack Trace:

[HttpException (0x80004005): The value ''2006. 07. 11.'' of the MaximumValue
property of ''rngDate'' cannot be converted to type ''Date''.]
System.Web.UI.WebControls.RangeValidator.ControlPr opertiesValid()
System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()
System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
...

解决方案

Hi Axel,

Are you sure your date of 2006.07.11 is allowed to have
spaces before month and day?

Regards,
Frank

Hi,

I''m working in a team developing an international website. When I set the
page''s CultureInfo to Hungarian (hu-HU) then the RangeValidator doesn''t seem
to be able to parse a TextBox''s date value (Exception message see below)
correctly.

The TextBox''s value is coming from the DateTime.Now.ToShortDateString()
function, so it''s an original .NET value.

Can someone please help me out on this? I need to be able to get this
application running until end of the week.

TIA,
Axel Dahmen

------------------------------
The value ''2006. 07. 11.'' of the MaximumValue property of ''rngDate'' cannot
be converted to type ''Date''.

Exception Details: System.Web.HttpException: The value ''2006. 07. 11.'' of
the MaximumValue property of ''rngDate'' cannot be converted to type ''Date''.

Stack Trace:

[HttpException (0x80004005): The value ''2006. 07. 11.'' of the MaximumValue
property of ''rngDate'' cannot be converted to type ''Date''.]
System.Web.UI.WebControls.RangeValidator.ControlPr opertiesValid()
System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()
System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
...


Well, I guess so,

the value is coming from .NET so it should be alright. It works for all the
other languages we''ve implemented so far (e.g.: de, en, fr, nl, cz)...

This is the code:

public DateTime MaximumDate
{
get {return Convert.ToDateTime(rngDate.MaximumValue);}
set {rngDate.MaximumValue=value.ToShortDateString();} // <--- *****
}

TIA,
Axel

----------------
"Frank Lehmann" <f.******@chat4world.comwrote in message
news:uL**************@TK2MSFTNGP03.phx.gbl...

Hi Axel,

Are you sure your date of 2006.07.11 is allowed to have
spaces before month and day?

Regards,
Frank

Hi,

I''m working in a team developing an international website. When I set

the

page''s CultureInfo to Hungarian (hu-HU) then the RangeValidator doesn''t

seem

to be able to parse a TextBox''s date value (Exception message see below)
correctly.

The TextBox''s value is coming from the DateTime.Now.ToShortDateString()
function, so it''s an original .NET value.

Can someone please help me out on this? I need to be able to get this
application running until end of the week.

TIA,
Axel Dahmen

------------------------------
The value ''2006. 07. 11.'' of the MaximumValue property of ''rngDate''

cannot

be converted to type ''Date''.

Exception Details: System.Web.HttpException: The value ''2006. 07. 11.''

of

the MaximumValue property of ''rngDate'' cannot be converted to type

''Date''.


Stack Trace:

[HttpException (0x80004005): The value ''2006. 07. 11.'' of the

MaximumValue

property of ''rngDate'' cannot be converted to type ''Date''.]
System.Web.UI.WebControls.RangeValidator.ControlPr opertiesValid()
System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()
System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
...



Hi Axel,

I''m a bit speculating because I''m everything else but an expert in using
CultureInfo:
Could there be a connection with the Regional Settings in Control Panel
so that Windows itself isn''t Hungarian and the Windows date format overrides
the CultureInfo?

Regards,
Frank

Well, I guess so,

the value is coming from .NET so it should be alright. It works for all the
other languages we''ve implemented so far (e.g.: de, en, fr, nl, cz)...

This is the code:

public DateTime MaximumDate
{
get {return Convert.ToDateTime(rngDate.MaximumValue);}
set {rngDate.MaximumValue=value.ToShortDateString();} // <--- *****
}

TIA,
Axel

----------------
"Frank Lehmann" <f.******@chat4world.comwrote in message
news:uL**************@TK2MSFTNGP03.phx.gbl...

Hi Axel,

Are you sure your date of 2006.07.11 is allowed to have
spaces before month and day?

Regards,
Frank

Hi,
>
I''m working in a team developing an international website. When I set

the

page''s CultureInfo to Hungarian (hu-HU) then the RangeValidator doesn''t

seem

to be able to parse a TextBox''s date value (Exception message see below)
correctly.
>
The TextBox''s value is coming from the DateTime.Now.ToShortDateString()
function, so it''s an original .NET value.
>
Can someone please help me out on this? I need to be able to get this
application running until end of the week.
>
TIA,
Axel Dahmen
>
------------------------------
The value ''2006. 07. 11.'' of the MaximumValue property of ''rngDate''

cannot

be converted to type ''Date''.
>
Exception Details: System.Web.HttpException: The value ''2006. 07. 11.''

of

the MaximumValue property of ''rngDate'' cannot be converted to type

''Date''.

>
Stack Trace:
>
[HttpException (0x80004005): The value ''2006. 07. 11.'' of the

MaximumValue

property of ''rngDate'' cannot be converted to type ''Date''.]
System.Web.UI.WebControls.RangeValidator.ControlPr opertiesValid()
System.Web.UI.WebControls.BaseValidator.get_Proper tiesValid()
System.Web.UI.WebControls.BaseValidator.Render(Htm lTextWriter writer)
System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer)
System.Web.UI.Control.Render(HtmlTextWriter writer)
...
>
>



这篇关于NET1.1:RangeValidator不适用于匈牙利语DateTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆