Take the 2-minute tour ×

I have seen the error "The ';' character, hexadecimal value 0x3B, cannot be included in a name." in my log files for an ASP.NET Web App. The url that's logged looks something like this:


So my first question is what type of system/browser is encoding the original query string? (This happens rarely)

I've tried to address this problem with the following snippet of code in the Page_Load() event:

string rawUrl = Request.RawUrl;
if (rawUrl.Contains(amp))
    rawUrl = rawUrl.Replace("&amp;", "&");
    Server.Transfer(rawUrl, false);

However when it transfers back to this page the &amp; is back in the query string. So I'm guessing that the .Transfer() function encodes the first param.

Suggestions about solving this problem?

share|improve this question
add comment

2 Answers

  1. Your web server should be able to log the "user agent" field from the HTTP Request, which should enable you to identify the culprit.

  2. Don't fix it - there's a very well defined set of legal syntaxes for URI parameters, and this ain't one of them.

share|improve this answer
I appreciate the sentiment in not fixing it, however, wouldn't you rather redirect a user to the correct resource (301 permanent redirect) if they are requesting it incorrectly? –  Guy Nov 26 '08 at 18:05
add comment

When you try to export a Microsoft catalog to XML, the resulting file cannot be imported, and you receive the following error message "The XML file path/filename contains an error at line. " "A Name contained an invalid character."

If you validate the XML catalog by using Microsoft Visual Studio .NET you receive the following error message:

"The '(' character, hexadecimal value 0x28, cannot begin a name. Line #, Position #"

This problem occurs because the Commerce Server export was not encoding the following special characters:

The range 0x0021 – 0x002F includes ! “ # $ % & ‘ ( ) * + , - . /
The range 0x03A – 0x0040 includes : ; < = > ? @
The range 0x007B – 0x007E includes { | } ~
The range 0x005B – 0x005E [ \ ] ^**
share|improve this answer
add comment

Your Answer


