BUG: Ampersand Character in an Attribute Value Is Converted to an Entity When You Switch from Design View to HTML View (821345)
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
SYMPTOMSYou have ampersand character (&) in an attribute value of an ASP.NET
server control. When you switch from HTML view to Design view in Microsoft Visual Studio .NET,
the ampersand character is converted to
an entity (&). When this problem occurs, the compiler may raise an error.WORKAROUNDTo work around this problem, implement data that assigns functionality in a method in the codebehind
file instead of in the .aspx file. To do this, follow these steps: - Start Microsoft Visual Studio .NET.
- Create a new ASP.NET Web Application
project in the following location: By default, WebForm1.aspx is created.
- Drag a
HyperLink ASP.NET
server control to WebForm1.aspx.
- In Design view, right-click WebForm1.aspx,
and then click View Code.
- Change the code of the Page_Load event as follows:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
HyperLink1.NavigateUrl = Request.ApplicationPath & "/WebForm2.aspx"
End Sub
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
REFERENCES For
additional information, click the following article number to view the article
in the Microsoft Knowledge Base: 316946
BUG: Visual Studio .NET Editor Malforms HTML Tags
For more information about data binding, visit the
following Microsoft Web site:
Modification Type: | Major | Last Reviewed: | 7/25/2003 |
---|
Keywords: | kbpending kbDataBinding kbWebForms kbhtml kbbug KB821345 kbAudDeveloper |
---|
|