Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:45:35+00:00 2026-06-11T14:45:35+00:00

I have a .NET 3.5 web site with a table tag that contains col,

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:45:36+00:00Added an answer on June 11, 2026 at 2:45 pm

    This appears to be an undocumented breaking change for web sites after the install of Visual Studio 2012 and .NET 4.5. I am not able to find references to this in the .NET 4.5 changes documented by Microsoft: http://msdn.microsoft.com/en-us/library/hh367887.aspx

    After researching the problem, the following appear to be possible solutions to the broken table tag.

    1. Uninstall Visual Studio 2012 and .NET 4.5. Reference: Server side HTML table with tbody not compiling in ASP.NET 4.5

      I realize that this is not necessarily an ideal solution, but if none of the other solutions below can be implemented easily, you may end up with no other choice. Also, just because this is the first entry, it is not what I am recommending as the primary solution. It’s just an option.

    2. Convert your web site into a web application. The table with runat=”server” appears to compile file when using a web application.

      There are additional benefits to doing this conversion, such as making it easier to write unit tests against the code inside your web application. However, you will need to evaluate the work involved with converting from a web site to a web application, and you will need to convince your bosses and fellow coworkers that you need to make this change.

    3. Check the server side code (code behind page/control) for the table. Are you using the control in the server side code? If not, remove runat=”server”. The page then compiles just fine.

      <table id="TestTable">
          <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>
      
    4. You are using the control in the server side code. Remove the col and colgroup tags and move the column stylings into the td or th cells of the first row of the table. (Column width and stylings inherit from the first row down the table, so setting width=”40%” on the first cell, for example, makes all cells in that column have width=”40%”.) Remove the thead tag and change all td cells in the table to th (table header) cells. Remove the tbody tag.

      <table id="TestTable" runat="server">
          <tr>
              <th width="30%">Sample header 1</td>
              <th width="70%">Sample header 2</td>
          </tr>
          <tr>
              <td>Sample cell 1</td>
              <td>Sample cell 2</td>
          </tr>
          <tr>
              <td>Sample cell 3</td>
              <td>Sample cell 4</td>
          </tr>
      </table>
      
    5. Convert to using the <asp:Table> tag with <asp:TableHeaderRow> and <asp:TableRow> controls. Reference: How to create thead and tbody in ASP.NET Table?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a asp.net web site that contains some tables. However these are not
I have a asp.net web site that was developed on the .Net Framework v2
I have a .net 3.5 web site that works fine when I run it
I have an ASP.NET web site that has a entities version 4.0 DAL. I
I have an MVC3 C#.Net web site and I have a lookup table Methods
I have an ASP.Net web site (ASPX and ASMX pages) with a single web.config
I have a asp.net web site built with .net 2.0 framework. we recently purchased
I have an ASP.NET web site with something similar to the following code: .aspx
I have an ASP.NET Web Forms web site. It has a page inside of
I have an ASP.NET MVC web site. I have many actions which require authentication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.