简体   繁体   中英

Textbox Mode DateTimeLocal not working when deployed to IIS

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Cannot create an object of type 'System.Web.UI.WebControls.TextBoxMode' from its string representation 'DateTimeLocal' for the 'TextMode' property.

Source Error:

I set my Textbox TextMode=DateTimeLocal and ran my project and it runs well. When I tried to deploy my application to IIS and visit the webpage i would get the error above. IIS has .Net 4.0.30319 . Is there a reason why i get it on localhost (on my computer) and not the server (iss)? how do i fix this?

There are only three members in the TextBoxMode Enumeration for ASP.NET 4.0 :

  1. SingleLine: Represents single-line entry mode.
  2. MultiLine: Represents multiline entry mode.
  3. Password: Represents password entry mode.

There are a considerable amount more, including DateTimeLocal in TextBoxMode Enumeration for ASP.NET 4.5 .

Your localhost is running ASP.NET 4.5, and apparently your server is not... ensure you have ASP.NET 4.5 installed on your server.

UPDATE: for people who can't upgrade to ASP.NET 4.5, you can likely just set the type="datetime-local" for the TextBox as an alternative.

在服务器上安装asp.net 4.5即可使用!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM