Microsoft KB Archive/820109

From BetaArchive Wiki
Knowledge Base


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.

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="<a href="http://www.msn.com">Go To MSN</a>"></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


Keywords: kbwebforms kbprb kbhtml kbcontrol KB820109