| John's profileJohn BarshingerPhotosBlogLists | Help |
|
October 09 ASP.NET UrlEncode? not so fast, grasshopper.One would think using Server.UrlEncode() AKA HttpUtility.UrlEncode would take care of all the special characters in whatever string you pass it and return to you a URL that you can actually use. After all, that's what the name of the method implies, doesn't it?
Au contraire! a bad thing that UrlEncode does is replace spaces with "+". You would think this is ok and sometimes it is but sometimes it is not. The better thing to do is replace spaces with "%20". Luckily, there is a new method which does just that. If you are having problems feeding out URLs that work, try this method instead:
System.Uri.EscapeUriString()
--------
Qapla' |
|
|