开发者

ASP.net MVC - Can I tell Html.Partial where to find the view?

开发者 https://www.devze.com 2023-04-10 17:52 出处:网络
I have a view that lives in /Views/Projects and I am making a call to render a partial view: @Html.Partial(\"_NotesPartial\")

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开发者_StackOverflow社区 Projects and Shared?


Can you pass in the full path?

@Html.Partial("~/Views/Projects/_NotesPartial.cshtml")
0

精彩评论

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