ASP.Net的错误 - 类型与控制的类型兼容类型、错误、ASP、Net

2023-09-03 17:05:01 作者:半世琉璃ザ倾城殇

我有一个网站,我创建使用VS2012网络版,

I have a web site i created using VS2012 web edition,

运行VB.net ASP网站

Running a VB.net asp web site,

在编译和一切工作好VS2012调试/释放模式, 当我把它上传到服务器(Windows Server 2008 R2),我收到以下错误:

In the VS2012 debug/release mode it compiles and everything works good, When i upload it to a server (Windows server 2008 R2) I get the following error:

The base class includes the field 'html', but its type (System.Web.UI.HtmlControls.HtmlElement) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).


Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 4:  <html id="html" xmlns="http://www.w3.org/1999/xhtml" dir="ltr" runat="server">
Line 5:  <head id="Head1" runat="server">
Line 6:    <title></title>

我查了一下在网络上发现这一点: VS 2010:类型System.Web.UI.HtmlControls.HtmlGenericControl的价值不能被转换为System.Web.UI.HtmlControls.HtmlTableRow

I looked a bit on the web and found this : VS 2010: Value of type 'System.Web.UI.HtmlControls.HtmlGenericControl' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'

安装了它,但没有任何帮助,

Installed it but no help,

我创建从另一个vb.net项目重新创建的网站,所以我用一个web.config从旧的,也许它有什么关系呢,我没有集结号属性是此XML。

The site i created was re-created from another vb.net project so i used a web.config with from the old one, maybe it has something to do with it, i have no "assembly" properties it this XML.

这是不相关的母版页其他网页(即HTML标记是一个母版页上运行...)工作的罚款。

Other pages that are not related to that master page (that html tag is running on a master page...) work's fine.

推荐答案

OK,

于是尝试了很多东西,没有工作,我发现了一个解决方案,我不喜欢这个解决方案,但它的工作原理,

So after trying a lot of stuff that didnt work i found a solution, i dont like this solution but it works,

我去了 page.designer.vb 文件,然后找了HTML和头像1'的属性,生成有,

I went to the page.designer.vb file, and then looked for the 'html' and 'Head1' properties that were generated there,

在那里,我代替他们的类型 System.Web.UI.HtmlControls.HtmlGenericControl

In there i replaced their types to System.Web.UI.HtmlControls.HtmlGenericControl

之后,它的工作。

奇怪的错误,没有别的(包括中提到的其他职位,帮助修复。

Weird bug, nothing else (including the "hot fixes" that are mentioned in other posts helped.

希望这将有助于有人在那里。

Hope this would help some one out there .