Microsoft Knowledge Base Email Alertz

KBAlertz.com: You may receive a parser error under the following circumstances:

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: 316946 - Last Review: August 29, 2005 - Revision: 3.1

Visual Studio .NET editor malforms HTML tags

This article was previously published under Q316946

On This Page

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 <FORM> 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 <FORM> tag.
This problem occurs with other HTML elements such as <A>, <LABEL>, < B >, <TEXTAREA>, and others. However, this issue was resolved for certain tags such as the <DIV> and <SPAN> 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:
<FORM id="myform" method="post" runat="server">
  <SPAN id="MySpan" runat="server"></SPAN>
</FORM>
- or -
<FORM id="myform" method="post" runat="server">
  <SPAN id="MySpan" runat="server" />
</FORM>
Notice that the second code sample includes a space before the end tag (/>).

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

  1. Create a new Visual Studio .NET Web Application project.
  2. Add a new Web form, and then open the form in HTML view.
  3. Add the following code in HTML view:
    <FORM id="myform" method="post" runat="server">
      <SPAN id="MySpan" runat="server"/>
    </FORM>
  4. Switch between design view and HTML view repeatedly. Notice that the code eventually changes to:
    <FORM id="myform" method="post" runat="server">
      <SPAN id="MySpan" runat="server">
    </FORM>
    </SPAN>
  5. Save and browse to the page.

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 ASP.NET (included with the .NET Framework)
Keywords: 
kbvs2002sp1sweep kbbug kbdesigner kbgrpdsasp kbhtml kbideproject kbpending kbwebforms KB316946
       

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

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please