在自定义编辑器模板中,我要访问父对象。
我正在使用此代码,但这可能不是最好的方法,尤其是在使用嵌套视图时:
object parent = ViewContext.Controller.ViewData.Model;
有人有更好的主意吗?
asp.net-mvc editortemplates asp.net-mvc-2
asp.net-mvc ×1
asp.net-mvc-2 ×1
editortemplates ×1