tags:

views:

44

answers:

3

Whats the point of HttpUtility.UrlDecode when .net already decodes the querystring when you request it.

Is this a hangover from classic ASP or am I missing something?

+6  A: 

It is needed in case you received UrlEncoded data from other sources then querystring.

Andrey
+4  A: 

It could be useful when you are getting content from another source which does not decode the data itself, as well. It is true that it is generally not needed, yes; but when it is needed, it's nice to have a Framework-level function that works as the complement to HttpUtility.UrlEncode

(as a side note; I may be remembering wrong, but I don't think I used UrlDecode much in classic ASP, either.)

Andrew Barber
+1  A: 

It can be used for a variety of things. Such as, the user submits a form where one of the fields contains a url to another website. Before displaying it you want to make sure it's decoded so that it displays "nicely".

klausbyskov