PRB: Ad Rotator Error Occurs When AdUrls Contain an Ampersand (&) Symbol (321812)
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
This article was previously published under Q321812 SYMPTOMS
If the AdUrl in an XML file that is associated with an AdRotator WebForms control contains an ampersand ( &) symbol, you receive the following server error message:
Server Error in '/AppName' Application.
This is an unexpected token. Expected 'SEMICOLON'. Line 8, position 53
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Xml.XmlException: This is an unexpected token. Expected 'SEMICOLON'. Line 8, position 53.
CAUSE
The error message occurs because the & symbol invalidates the XML file that is associated with the AdRotator control.
RESOLUTION
If you have to put an & symbol in the XML file (such as in the querystring of the URL specified for the NavigateUrl), you must replace it with & (the ampersand symbol, "amp", and a semicolon).
STATUSThis behavior is by design.REFERENCES
For more information about AdRotator server controls and ASP.NET server controls, visit the following MSDN and Microsoft Knowledge Base Web sites:
306459 INFO: ASP.NET Server Controls Overview
Modification Type: | Minor | Last Reviewed: | 7/8/2003 |
---|
Keywords: | kbprb kbServerControls kbWebForms KB321812 kbAudDeveloper |
---|
|