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

In short, but simple?

I have edit.ascx in a shared folder. I call it this way:

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

If I put it in a subfolder, it cannot find the file, how can I fix it?

+3
source share
1 answer

In terms of how you organize your views, you can put your views in subfolders if you want and create your own presentation structure. All views can always refer to their full path using syntax. Therefore, if you put Index.aspx in \ Views \ Feature1 \ Home, you can reference this view using ~ / Views / Feature1 / Home / Index.aspx.

- asp.net mvc -

+2

Source: https://habr.com/ru/post/1765830/


All Articles