Stefanvds
Stefanvds

Reputation: 5916

Renderpartial in subfolder of Shared folder. How to make MVC find it?

Short but simple?

I have an edit.ascx is in the shared folder. I call it like this:

<% Html.RenderPartial("edit", item.hlpb_ID); %>

If I put it in a subfolder, it cant find the file, how to fix that?

Upvotes: 3

Views: 4497

Answers (1)

David Pfeffer
David Pfeffer

Reputation: 39833

In terms of how you arrange your views, you can put your views in subfolders if you'd like and create your own view structure. All views can always be referenced by their full path using the ~syntax. So if you put Index.aspx in \Views\Feature1\Home then you could reference that view using ~/Views/Feature1/Home/Index.aspx.

-- asp.net mvc - subfolders

Upvotes: 2

Related Questions