user496949
user496949

Reputation: 86085

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: 30830

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

Upvotes: 1

Jakob
Jakob

Reputation: 24360

HttpServerUtility.UrlEncode or HttpUtility.UrlEncode in System.Web

Upvotes: 2

Related Questions