Hi,
You can use
string destinationURL = "http://localhost:24882/WebSite2/ProductList/396/Micromax_Ninja_A89";
HttpContext.Current.Server.UrlEncode(destinationURL);
string url = "localhost:24882/WebSite2/ProductList/396/Micromax%20Ninja%20A89";
HttpContext.Current.Server.UrlDecode(url);
Note : (In url %20 is used for single blank space not for underscore)
One more thing what you actually need, Because In URL rewriting I think(as I used) there is no need for URL Encoding/Decoding as you need...
And one more thing never put answer in your posted question, If you have any query then post comment..
THANKS
ASP.NET BLOG - hemant[
^]