我想使用jquery设置我的输入文本的值。我已经这样尝试:如何设置@ Html.EditorFor在asp.net中使用jquery的值mvc
<div class="editor-label">
@Html.LabelFor(model => model.ID)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ID)
@Html.ValidationMessageFor(model => model.ID)
</div>
和jQuery语法:
$("#ID").val(data.ID);
但它无法正常工作。我曾尝试相同的jQuery代码与此:
<input type="text" id="ID" />
这种方法的工作,但我不知道为什么@ Html.EditorFor不使用jQuery .Thanks提前
有尝试$( “#ID”)VAL(data.ID)。 inside document.ready – Amit