.net MVC 2 controller inheritance
I have i little problem with inheritance of my controllers for example :
public class AController: Controller {
public ActionResult Index(long id)
{
return Index(id, isComposite);
}
}
public class BController : AController {
}
when i click on ..开发者_运维问答/B/Index/12 i get following exception : the view 'Index' or its master was not found. The following locations were searched: ~/Views/B/Index.aspx I can copy Index.aspx into "Shared" map but may be there is other workaround ? Thanks .
You could put it in ~/Views/Shared/Index.aspx
but in ASP.NET MVC it is better to avoid such type of controller inheritance.
精彩评论