MVC3 Html.DisplayFor — Is it possible to have this control generate an ID?

前端 未结 7 1772
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-08 17:16

I want to be able to display some text, but also have the text be modifiable via jQuery.

<%= Html.DisplayFor(model => model.DeviceComponentName)%>
         


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-08 18:03

    The easiest solution for me was to use a readonly text box. @Html.TextBoxFor(u => u.Visibilidade, new { disabled = "disabled" })

提交回复
热议问题