如何解码使用MVC的Url.Encode编码的URL(字符串url)

bra*_*ive 18 c# asp.net-mvc

我很惊讶UrlHelper提供编码器而不是解码器!有没有人有解码的代码或知道在MVC框架中找到它的位置?

Don*_*uts 46

实际上它应该是HttpUtility.UrlDecode,而不是HttpServerUtility.

  • @AndrewBarber都存在,这是对的.但是`HttpServerUtility`没有`UrlDecode`方法.这个方法存在于`HttpUtitliy`类中. (2认同)

Yur*_*ich 11

HttpServerUtility.UrlDecode

  • 请修复此问题,如下所述它应该是httputility,而不是服务器. (11认同)

小智 5

HttpUtility.UrlDecode(Parameter);
Run Code Online (Sandbox Code Playgroud)