开发者

.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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜