user959883
user959883

Reputation:

Decoding http link in .NET

I am opening a page from my javascript and passing variable to it like below

 <script type="text/javascript">
        function myFunction(what) {
            var valu = what.value;
            var w = window.open("playaudio.aspx?" + what.value);

            return false;
        } 

Now on my playaudio.aspx i am doing this to decode back the %2f and %3f etc into / and ?

string FilePath = HttpUtility.HtmlDecode(Request.QueryString.ToString());

but the problem is that the string FilePath remains unchanged . Any advice on how to change the %2f into / .

Upvotes: 0

Views: 99

Answers (2)

Svetlin Panayotov
Svetlin Panayotov

Reputation: 620

See HttpUtility.UrlDecode - I believe that's what you're after.

Upvotes: 1

SLaks
SLaks

Reputation: 887245

That's because URLs are not HTML encoded.

You need UrlDecode.

Upvotes: 3

Related Questions