user496949
user496949

Reputation: 86185

Uri to URLencoded string

I have an object of Uri. How to get the Urlencoded string? Any builtin support of Uri class?

Upvotes: 0

Views: 362

Answers (2)

decyclone
decyclone

Reputation: 30840

Use Uri.EscapeDataString() and Uri.UnescapeDataString() static methods of Uri class.

Upvotes: 1

Jakob
Jakob

Reputation: 24370

HttpServerUtility.UrlEncode or HttpUtility.UrlEncode in System.Web

Upvotes: 2

Related Questions