Escaping characters i nfriendly URL?
-
Hi! Let's say I'm building a personal music toplist and want to be able to use freiendly urls to map from http://mysite/artist.aspx?id=12 to http://mysite/artist/madonna. This works fine using an HttpHandler and catchin the web request. However what about bands like AC/DC or Simon&Garfunkel? How can I escape the characters "/" and "&" etc.??
-
Hi! Let's say I'm building a personal music toplist and want to be able to use freiendly urls to map from http://mysite/artist.aspx?id=12 to http://mysite/artist/madonna. This works fine using an HttpHandler and catchin the web request. However what about bands like AC/DC or Simon&Garfunkel? How can I escape the characters "/" and "&" etc.??
-
...how this article relates to my problem? I have written an HttpHandler but when executing the following URl's I don't get the expected result:
<a href=\"/artist/AC/DC\">AC/DC</a> //Handled "/" character as expected <a href=\"/artist/AC%2fDC\">AC%2fDC (/ )</a> //Expected to get the path "artist" and "AC/DC" <a href=\"/artist/AC%20DC\">AC%20DC ( )</a> //Works <a href=\"/artist/AC%26DC\">AC%26DC (& )</a> //Works <a href=\"/artist/AC%3aDC\">AC%3aDC (: )</a> //"Bad request", expected "artist" and "AC:DC" <a href=\"/artist/AC%2aDC\">AC%2aDC (* )</a> //"Bad request", expected "artist" and "AC&DC"