PRB:HTML Controls Embedded Inside a Server Control Are Malformed When You Modify the Server Control Properties In Design View (820109)



The information in this article applies to:

  • Microsoft ASP.NET (included with the .NET Framework 1.1)
  • Microsoft ASP.NET (included with the .NET Framework) 1.0
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition

SYMPTOMS

When you use HTML controls inside an ASP.NET server control, and then you modify the server control properties in Design view, the HTML controls are malformed.

WORKAROUND

To work around this problem, you can do either of the following:
  • Change the required properties of the server control, and then embed the HTML control in the server control.

    -or-
  • Embed the HTML control in the server control, and then do not change the properties of the server controls.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Behavior


  1. Start Microsoft Visual Studio .NET.
  2. On the File menu, point to New, and then click Project.
  3. Under Project Types, click Visual C# .NET, or click Visual Basic .NET.
  4. Under Templates, click ASP.NET Web Application.
  5. In the Location text box, name the project TestApp, and then click OK.
  6. By default, WebForm1.aspx is created.
  7. Right-click Design view, and then click View HTML Source.
  8. To add an ASP table with an anchor tag inside, replace the existing code in the <form> tag of the WebForm1.aspx page, with the following code:
          <form id="Form1" method="post" runat="server">
             <asp:Table ID="table1" runat="server">
                <asp:TableRow>
                   <asp:TableCell ><a href="http://www.msn.com">Go To MSN</a></asp:TableCell>
                </asp:TableRow>
             </asp:Table>
          </form>
     
  9. In Design View, right-click Table1, and then click Properties.
  10. Change the Border Style to Solid.
    Note You may notice similar behavior when you change any other property of Table1.
  11. Right-click Design view, and then click View HTML Source. You notice the following malformed anchor tag, <a>:
    <asp:TableCell Text="&lt;a href=&quot;http://www.msn.com&quot;&gt;Go To MSN&lt;/a&gt;"></asp:TableCell>

REFERENCES


For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

306459 INFO: ASP.NET Server Controls Overview


Modification Type:MajorLast Reviewed:6/27/2003
Keywords:kbWebForms kbhtml kbControl kbprb KB820109 kbAudDeveloper