3

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

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

The Content method just converts a virtual path to an absolute application path. What is there to Encode?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.