我有表单,其中有文本框值和链接(添加)。当用户在文本框中输入数据并单击添加时,它应该将输入的文本添加到同一视图的 textArea 中。我曾尝试使用 ajax.actionlink 执行此操作,但我似乎无法弄清楚如何将输入的文本传递给参数。谁能有另一个想法我可以尝试..我不能使用 Ajax.beginForm 因为我已经有 html 表单。
先感谢您。
这是到目前为止我使用 ajax 操作链接的 html 代码。
<div class="editor-label">
<%: Html.Label("DefectID / FeatureID")%> <%: Html.TextBox("DefectID", "", new { @class = "required" })%> <%: Ajax.ActionLink("Add", "InsertDefectIDs", new AjaxOptions { UpdateTargetId = "DefectIds" }) %><%--<input type="button" name="add" value="Add" />--%>
</div>
<div class="editor-field">
<%: Html.TextAreaFor(model => model.DefectIds, new { rows = 5, cols = 12, @readonly = "true" })%>
<%: Html.ValidationMessageFor(model => model.DefectIds)%>
</div>