Microsoft KB Archive/820109

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

Article ID: 820109

Article Last Modified on 6/27/2003

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * 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.



Steps to Reproduce the Behavior
 Start Microsoft Visual Studio .NET. On the File menu, point to New, and then click Project. Under Project Types, click Visual C# .NET, or click Visual Basic .NET. Under Templates, click ASP.NET Web Application. In the Location text box, name the project TestApp, and then click OK. By default, WebForm1.aspx is created.</li> Right-click Design view, and then click View HTML Source.</li>  To add an ASP table with an anchor tag inside, replace the existing code in the tag of the WebForm1.aspx page, with the following code: <form id=&quot;Form1&quot; method=&quot;post&quot; runat=&quot;server&quot;> <asp:Table ID=&quot;table1&quot; runat=&quot;server&quot;> <asp:TableRow> <asp:TableCell ><a href=&quot;http://www.msn.com&quot;>Go To MSN</a></asp:TableCell> </asp:TableRow> </asp:Table> </li> In Design View, right-click Table1, and then click Properties .</li> Change the Border Style to Solid.

Note You may notice similar behavior when you change any other property of Table1.</li>  Right-click Design view, and then click View HTML Source. You notice the following malformed anchor tag, <a>: <asp:TableCell Text=&quot;&lt;a href="http://www.msn.com"&gt;Go To MSN&lt;/a&gt;&quot;></asp:TableCell> </li></ol>

<div class="references_section">