与TBODY服务器端HTML表中ASP.NET 4.5不编译 [英] Server side HTML table with tbody not compiling in ASP.NET 4.5
本文介绍了与TBODY服务器端HTML表中ASP.NET 4.5不编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
如何在ASP.NET中创建表THEAD和TBODY?
下面的HTML不会在ASP.NET网页编译
The following HTML does not compile in an ASP.NET Website
<table runat="server" id="tbl1">
<tbody>
<tr>
<td>
</td>
</tr>
</tbody>
</table>
我得到这个编译错误:
I get this compilation error:
The best overloaded method match for ‘System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)’ has some invalid arguments
- 此错误开始出现我安装VS2012后.NET 4.5
- 它发生在两个VS2012和VS2010
- 它出现在ASP.NET网站项目模板中,code编译在ASP.NET WebApplication的项目模板精细
- 错误删除RUNAT属性或TBODY标签时消失
- 奇怪的是,该项目编译失败,但成功的出版没有错误
- 页面正确呈现在浏览器
- 如果我卸载VS2012和.NET 4.5一样code在VS2010再次工作
更新:
我不知道为什么这个问题被摆在首位关闭,这是不是重复。无论如何,微软已经承认这是一个错误,并努力解决这个问题。更多信息<一个href=\"http://connect.microsoft.com/VisualStudio/feedback/details/766115/value-of-type-system-web-ui-htmlcontrols-htmlgenericcontrol-cannot-be-converted-to-system-web-ui-htmlcontrols-htmltablerow\"相对=nofollow>这里
I'm not sure why this question was closed in the first place, it wasn't a duplicate. Anyway, Microsoft has acknowledged this as a bug and is working on a fix. More info here
推荐答案
您可能会想尝试:
<table id="yourId" runat="server">
<thead>
.
.
.
</thead>
<tbody>
<tr>
<td>
</td>
</tr>
</tbody>
</table>
这篇关于与TBODY服务器端HTML表中ASP.NET 4.5不编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文