tags:

views:

20

answers:

3

I have a url that I would like to put into my web.config file.

http://google.com?parcel&bob&&smith

I imagine that the .net run time is upset with the ampersand's so i encoded them to be &amp.

http://google.com?parcel&ampbob&amp&ampsmith

This also doesn't work. Any ideas would be great, if you could supply a link to the documentation of why this is that would be even better. Thank you very much!!!

+5  A: 

did you try this? (semicolons)

http://google.com?parcel&bob&smith
bluevoodoo1
+3  A: 

The proper encoding for the ampersand is & You are missing the ; at the end.

Andrew Barber
A: 

I guess that is because you are missing the ';'. Try to use the HttpUtility.HtmlEncode method for encoding....

Bernd
Whoever modded this down should have explained why they did it. I think the issue is that it's in web.config, and thus not something you can add with code.
Kendrick
Agreed. Anonymous downvoting is the bane of our voting system.
Mike Hofer
Thanks guys - I was not trying to say you should use HttpUtility in web.config but rather to help you to get an correctly encoded string... But that was not well explained.
Bernd