如何更改@ html.editor,以便在我要添加新数据时可以输入它,而在我要编辑时将其禁用?

时间:2019-01-17 04:11:41

标签: c# asp.net-mvc razor asp.net-mvc-5 html-helper

如何更改@html.editor,以便在我要添加新数据时可以输入? 并且@html.editor在我要编辑时将处于非活动状态吗? (ASP.NET MVC)

@Html.EditorFor(item => data.id, 
                "DataShow" + (isEdit ? "Edit" : "Add"), 
                new { 
                      disabled = "disabled", 
                      type = "text", 
                      name = "id MIDTID", 
                      placeholder = "MIDTID Id"
                })

0 个答案:

没有答案