28

I have a view that lives in /Views/Projects and I am making a call to render a partial view:

@Html.Partial("_NotesPartial")

The view that I want to render actually exists in the /Views/Notes folder but I can't figure out how to tell MVC to search that folder for this specific call. Is there an overload I can call to have MVC look for this view in this folder instead of Projects and Shared?

1

1 Answer 1

42

Can you pass in the full path?

@Html.Partial("~/Views/Projects/_NotesPartial.cshtml")
Sign up to request clarification or add additional context in comments.

1 Comment

I guess I didn't realize that was possible :)

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.