开发者

What's the point of HttpUtility.UrlDecode

What's the point of HttpUtility.UrlDecode when .net already decodes the querystring when you requ开发者_运维问答est it.

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


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


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.)


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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜