CSHTML file outside the view folder
I have an ASP.NET MVC project and I want to put CSHTML files outside of the Views folder. While I can do this easily by adding the CSHTML files to the correct folder, I cannot display a partial result from those files.
The folder structure I currently have is something like this: root | | --Templates | | --- Welcome.cshtml | | --Views | | ---
I am using the below syntax from one of the controller actions
public ActionResult Welcome()
{
return PartialView("Welcome");
}
However, while doing this, the razor cannot find Welcome.cshtml. I've read about using a custom view engine to change the default search location, etc., but wondering if this can be solved just by adding a config.
+3
source to share