加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – MVC EditorFor里面的另一个EditorFor

发布时间:2020-12-16 07:43:58 所属栏目:asp.Net 来源:网络整理
导读:我有一个模型角色的EditorFor模板,如下所示.我还有EditorFor for Date,当我直接从View使用EditorFor但当我在编辑器中使用EditoFor时,它工作正常.任何的想法? Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl[ucsrManagementSystem.Models.
我有一个模型角色的EditorFor模板,如下所示.我还有EditorFor for Date,当我直接从View使用EditorFor但当我在编辑器中使用EditoFor时,它工作正常.任何的想法?

Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl[ucsrManagementSystem.Models.ContactsInMailingListsViewModel]"

Html.EditorFor(m => m.IsInMainlingList)  
Html.EditorFor(m => m.Id)  
Html.EditorFor(m => m.Name)  
Html.EditorFor(m => m.EndDate)//This is not showing Date's Editor Template when inside another EditorFor

解决方法

它对我也不起作用;我假设它是某种反递归保护.

如果你将外部调用’EditorFor’更改为’Partial’而不是指向相同的.cshtml文件 – 内部’EditorFor’将起作用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读