I have several action methods that can use the same view. I’ve tried calling View with eg
return View(“~/views/contact/Emails”, model);
The view “Emails” exists in the specified directory (Resharper underlines the URL), but when I run the application I get the error “The view ‘~/views/contact/Emails’ or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/views/contact/Emails”
Assuming you’re inside
ContactController, you can simply pass in the name of the view.MVC uses routing to find Views, so it doesn’t care about the file path, just the name (at least at this point in the request pipeline).