Microsoft Knowledge Base Email Alertz

KBAlertz.com: Error message when you build an ASP.NET 2.0 Web application in Visual Studio 2005: The base class includes the field 'tbodyname'

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 941824 - Last Review: December 3, 2007 - Revision: 1.2

Error message when you build an ASP.NET 2.0 Web application in Visual Studio 2005: "The base class includes the field '<tbodyname>'"

On This Page

SYMPTOMS

Consider the following scenario:
  • You create a Microsoft ASP.NET 2.0 Web application.
  • You add markup that resembles the following to the Web page.
    <body>
    	<form id="form1" runat='server">
    		<Table ID="Tablename" runat="server" Height="224px" Width="399px">
    			<tbody ID="tbodyname" runat="server"></tbody>
    		</Table>
    	</form>
    </body>
    
  • You build the application by using Microsoft Visual Studio 2005.
  • You install the Microsoft .NET Framework 3.5.
  • You open the project in Visual Studio 2005 and then build the application.
In this scenario, you receive an error message that resembles the following:
ASP.NET runtime error: The base class includes the field ‘tbodyname’, but its type (System.Web.UI.HtmlControls.HtmlGenericControl) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlTableBodySection).

CAUSE

In the .NET Framework 3.5, the following HTML tags no longer map to the HtmlGenericControl class:
  • tbody
  • thead
  • tfoot
In the .NET Framework 3.5, these tags map to the following classes:
Collapse this tableExpand this table
TagClass
tbodyHtmlTableBodySection
theadHtmlTableHeaderSection
tfootHtmlTableFooterSection
This change enables the layout options of the new ListView control.

Note When you install the .NET Framework 3.5, the .NET Framework files in the V2.0.50727 folder are updated. Therefore, when you install the .NET Framework 3.5, Visual Studio 2005 is affected.

RESOLUTION

To resolve this problem, update the Web page so that the HTML tags map to the new classes. You can do this manually. Or, you can use the Visual Studio 2005 designer to do this automatically.

Manual method

To manually resolve this problem, follow these steps:
  1. In Visual Studio 2005, open the PageName.aspx.designer.cs file.

    Note The placeholder PageName represents the name of the Web page on which you encounter the problem.
  2. Locate the entries for the tbody, thead, and tfoot tags.
  3. Change the entries to map these tags to the new classes. For example, make the following changes.

    Old entry
    protected global::System.Web.UI.HtmlControls.HtmlGenericControl tbodyname;
    New entry
    protected global::System.Web.UI.HtmlControls.HtmlTableBodySection tbodyname;
  4. Save the PageName.aspx.designer.cs file.

Automatic method

To automatically resolve this problem by using the Visual Studio 2005 designer, follow these steps:
  1. In Visual Studio 2005, open the PageName.aspx file.

    Note The placeholder PageName represents the name of the Web page on which you encounter the problem.
  2. In the Source window, locate the <table> and </table> tags, and then select all entries in the range that includes these tags.
  3. On the Edit menu, click Cut. This operation removes the corresponding entries from the PageName.aspx.designer.cs file.
  4. Keep the cursor in the same location.
  5. On the Edit menu, click Paste. This operation adds the entries that inherit the new classes back to the PageName.aspx.designer.cs file.
  6. Save the PageName.aspx file.

STATUS

This behavior is by design.

APPLIES TO
  • Microsoft ASP.NET 2.0
  • Microsoft .NET Framework 2.0
Keywords: 
kbexpertiseadvanced kbtshoot kbprb KB941824
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Santhosh Report As Irrelevant  
Written: 7/10/2008 2:26 AM
In my machine i am not getting build errors... what i should do to solve this problem. pls help me

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please