Create a controller:
public abstract class MyBaseController : Controller
{
public ActionResult MyAction(string id)
{
return View();
}
}
Than create another specific controller that inherit from MyBaseController:
public class MyController : MyBaseController
{
}
There is a view called MyAction.aspx in the Views/MyBaseController folder Then, call MyController/MyAction method. Following exception will be generated:
The view 'MyAction' or its master could not be found. The following locations were searched: ~/Views/MyController/PhConnect.aspx ~/Views/MyController/PhConnect.ascx ~/Views/Shared/MyAction.aspx ~/Views/Shared/MyAction.ascx
Can I make MVC.NET to use the view from Views/MyBaseController folder?