Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


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>

↑ Back to the top


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

↑ Back to the top


Keywords: kbwebforms, kbhtml, kbcontrol, kbprb, KB820109

↑ Back to the top

Article Info
Article ID : 820109
Revision : 4
Created on : 6/27/2003
Published on : 6/27/2003
Exists online : False
Views : 528