Textbox Mode DateTimeLocal not working when deployed to IIS

我与影子孤独终老i 提交于 2020-01-05 06:58:14

问题


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?


回答1:


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.




回答2:


Install asp.net 4.5 on server and works!



来源:https://stackoverflow.com/questions/19185524/textbox-mode-datetimelocal-not-working-when-deployed-to-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!