Microsoft KB Archive/316946

= Visual Studio .NET editor malforms HTML tags =

Article ID: 316946

Article Last Modified on 8/29/2005

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft .NET Framework 1.1 Service Pack 1

-



This article was previously published under Q316946





SYMPTOMS
In Microsoft Visual Studio .NET, you may receive a parser error under the following circumstances:
 * You use a Hypertext Markup Language (HTML) element.
 * You do not include a space between the end tag (/>) and the value of the last attribute that is located inside a  tag on a Web form in Microsoft Visual Studio .NET.
 * You open the page in your browser.

Under these circumstances, you may receive the following parser error:

Unexpected end of file looking for  tag.

This problem occurs with other HTML elements such as , , < B >, , and others. However, this issue was resolved for certain tags such as the  and  tags starting with Microsoft Visual Studio .NET 2003.



CAUSE
When you switch between design view and HTML view, the Visual Studio .NET editor changes the code in your Web form, which malforms the tags. This problem only occurs when you do not include a space between the end tag (/>) and the value of last attribute of the tag.



RESOLUTION
To work around this problem, modify the tag as follows:    - or -  <SPAN id=&quot;MySpan&quot; runat=&quot;server&quot; /> </FORM> Notice that the second code sample includes a space before the end tag (/>).

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

<div class="moreinformation_section">

Steps to reproduce the behavior
<ol> <li>Create a new Visual Studio .NET Web Application project.</li> <li>Add a new Web form, and then open the form in HTML view.</li> <li> Add the following code in HTML view:  <SPAN id=&quot;MySpan&quot; runat=&quot;server&quot;/> </FORM> </li> <li> Switch between design view and HTML view repeatedly. Notice that the code eventually changes to:  <SPAN id=&quot;MySpan&quot; runat=&quot;server&quot;> </FORM> </SPAN> </li> <li>Save and browse to the page.</li></ol>

Additional query words: span a textarea

Keywords: kbbug kbwebforms kbdesigner kbgrpdsasp kbhtml kbpending kbideproject kbvs2002sp1sweep KB316946

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.