菜单

2017赌博网站开户送金The value ‘5/15/2012’ of the MaximumValue property of ‘RangeValidator1’ cannot be converted to type ‘Date’.

2018年10月5日 - 2017赌博网站开户送金

 

Server Error in ‘/InsusTutorials’ Application.


The value ‘5/15/2012’ of the MaximumValue property of ‘RangeValidator1’ cannot be converted to type ‘Date’.

Description: An unhandled
exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and
where it originated in the code.

Exception Details:System.Web.HttpException: The value ‘5/15/2012’ of the
MaximumValue property of ‘RangeValidator1’ cannot be converted to type
‘Date’.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The value '5/15/2012' of the MaximumValue property of 'RangeValidator1' cannot be converted to type 'Date'.]
   System.Web.UI.WebControls.RangeValidator.ValidateValues() +1324866
   System.Web.UI.WebControls.RangeValidator.ControlPropertiesValid() +12
   System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +36
   System.Web.UI.Control.PreRenderRecursiveInternal() +103
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

 


 

Version Information:
Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

 

无异于各网友程序出现而上Error,他将程序发送过来,但是没数据库。Insus.NET只能拷贝程序要部分做测试了。现在Insus.NET把它帖出来,方便遇上等同题目的食指也堪开测试。

aspx:

2017赌博网站开户送金 12017赌博网站开户送金 2View Code

<asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox><br />
         <asp:RangeValidator ID=”RangeValidator1″ runat=”server” ErrorMessage=”请输入有效日期”
            Type=”Date” ControlToValidate=”TextBox1″ CultureInvariantValues=”True” SetFocusOnError=”True” Width=”131px”></asp:RangeValidator>

 

.aspx.cs:

2017赌博网站开户送金 32017赌博网站开户送金 4View Code

protected void Page_Load(object sender, EventArgs e)
    {     
        this.RangeValidator1.MinimumValue = DateTime.Today.ToShortDateString();
        this.RangeValidator1.MaximumValue = DateTime.Today.AddDays(365).ToShortDateString();
    }

 

当你run这些代码时,你见面发现错误的面世。

题目出以BaseCompareValidator.CultureInvariantValues
属性上。更多系消息,可以参见Microsoft
msdn网站:http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.basecomparevalidator.cultureinvariantvalues.aspx 2017赌博网站开户送金 5

 

缓解问题,把用拿CultureInvariantValues=”True”设为False或者是删除。

 

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图