Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does asp.net mvc Url.Content encode the string?

Tags:

asp.net-mvc

Does asp.net mvc Url.Content encode the input or should I also use Url.Encode on top of it?

like image 394
Gidon Avatar asked Dec 11 '25 00:12

Gidon


1 Answers

No.

According to http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.content(VS.90).aspx it only expands the ~ character. If that character does not exist then the path is returned as it was passed in.

You can also test it. Using ASP.Net 4.0 it did not for me.

like image 89
kervin Avatar answered Dec 13 '25 19:12

kervin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!