I am trying to include a partial view in a view that is in a different folder. Therefore, I have the following view:
/_mvc/Views/Home/Index.cshtml
It has the following line of code:
@Html.Partial("~/_mvc/Views/Subject/_QuickSearch.cshtml", Model.QuickSearchModel);
This does not work. I keep getting the following error:
The partial view '~/_mvc/Views/Subject/_QuickSearch' was not found or no view engine supports the searched locations. The following locations were searched: ~/_mvc/Views/Subject/_QuickSearch
Am I missing something obvious? I must indicate that I changed the routing for my application to put all the MVC code in the _mvc folder. It's not a mistake. The application is in the process of converting from WebForms to MVC, and I wanted all the MVC materials to be in the same folder.
source share