I have a .NET 3.5 web site with a table tag that contains col, colgroup, tbody and thead tags. This is a server side tag with the runat="server" attribute. This table was working fine in Visual Studio 2010, but after I installed Visual Studio 2012 and .NET 4.5, this tag now fails to compile in Visual Studio 2010 and in Visual Studio 2012. (I tried both.) Here are the compiler errors that are being thrown:
- The best overloaded method match for 'System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)' has some invalid arguments
- Argument '1': cannot convert from 'System.Web.UI.HtmlControls.HtmlGenericControl' to 'System.Web.UI.HtmlControls.HtmlTableRow'
Here's an example of what I'm working with:
<table id="TestTable" runat="server">
<colgroup>
<col width="30%" />
<col width="70%" />
</colgroup>
<thead>
<tr>
<td>Sample header 1</td>
<td>Sample header 2</td>
</tr>
</thead>
<tbody>
<tr>
<td>Sample cell 1</td>
<td>Sample cell 2</td>
</tr>
<tr>
<td>Sample cell 3</td>
<td>Sample cell 4</td>
</tr>
</tbody>
</table>
Does anyone know how to fix this problem, so that we can get the site to compile and continue working?
colgroup
fortable runat="server"
, so I doubt it's new in .NET 4.5. link - see second post by Steven Cheng. – Vibrant