Hi,
I'm having trouble with an ampersand in my URI. I'm working in a winform with a webbrowser. This is my code:
String test1 = "http://serv/reportserver /CUBE/CUBE02&rs:Command=Render&Budget=[Budget].[N Budget].";
String Testen =
test1 + "%26[1]"; (%26 is the same as &)
webBrowser1.Url = new Uri(Testen);
When the browsers opens he converts the url to :
http://serv/reportserver /CUBE/CUBE02&rs:Command=Render&Budget=[Budget].[N Budget].&[1]
He must not do that ! I tried everything (HttpUtility.urlEncode, ASCII encoding,...) The browser seems to convert it allways. Is there a way to resolve this

Ampersand
Siggy
Anab
Jish40289
woeter,
the %2526 works here... If I write:
webBrowser1.Url = new Uri ("http://localhost/test/test.aspx dummy=%2526moredata");
and then I have my ASP.NET app return the query string, I correctly see the "%26" in the string.
Now, if I were to call HtmlDecode on the QueryString somewhere, that would indeed become a "&"...
If you don't have access to the application (if you had, I guess you would have already changed your syntax), you might want to try further escaping the "%". Each time the string is decoded, a "%25" is converted to a "%".
Try sending "%252526", then "%25252526", then "%2525252526" ....
Hopefully, you will finally match the number of times the string is decoded. If the application is not consistent in the number of times it decodes the query, this won't work.
HTH
--mc
RKellogg
Beat him at his own game.
According to the RFC (2396, I think), the % is always escaped unless followed by exactly two hex digits.
So, in your case, you should write: "%2526", where %25 is the percent itself, and 26 are your digits. Your web app will correctly see "%26" in the query string.
HTH
--mc
Philip Fortier - MSFT
bluebunny
%26 shows &
%25 shows %25
%2526 shows &.
%252526 shows %2526
It's wierd !!