Monday , 1 May 2017
Home » Technology » Development » UrlPathEncode for ‘#’ Problem

UrlPathEncode for ‘#’ Problem

There seems to *still* be a problem with UrlPathEncode method in HttpUtility class (and others). ‘#’ doesn’t seem to be encoded properly. Here’s a quick way to do it.

string newUrl = HttpUtility.UrlPathEncode(url).Replace(“#”, “%23”);

I hope this gets fixed in the next framework iteration.

About Justin Lee

Check Also

Apple WWDC 2014 Videos Podcast RSS Feed Generator using XSLT

I realised there isn’t any podcast subscription link for the Apple WWDC 2014 videos at …

Leave a Reply