MSajjadi
MSajjadi

Reputation: 3839

Strings like %2c in query string

I log query string of a page. It's with C#.

How can i convert strings like %2c%20 to a normal string in C# code?

Upvotes: 0

Views: 3255

Answers (3)

Prashanth Thurairatnam
Prashanth Thurairatnam

Reputation: 4361

HttpUtility.UrlDecode will do. Check this MSDN link

Upvotes: 1

Tim Schmelter
Tim Schmelter

Reputation: 460148

If the string is in the current request's url-parameters, you can use Request.QueryString to access it which decodes it implicitely. Otherwise use HttpUtility.UrlDecode.

Upvotes: 1

Fredrik Leijon
Fredrik Leijon

Reputation: 2802

HttpUtility.UrlDecode

Upvotes: 2

Related Questions