我有一個表單,它有一些字段。我想在用戶在表單字段之一的文本框中輸入數字時顯示一些標籤。 我知道我必須使用Ajax,但問題在於Ajax表單處於另一種形式。因此,當我提交Ajax表單時,表單提交併且我無法獲取Ajax請求。 這裏是我的代碼結構:在MVC3中提交Ajax表單
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset style="font-family:'B Nazanin';font-size:14pt">
<div align="center">
<table border="0">
<tr align="center">
<td>
@Html.LabelFor(model => model.a)
</td>
<td>
@Html.LabelFor(model => model.a)
@Html.EditorFor(model => model.a)
@Html.ValidationMessageFor(model => model.a)
</td>
</tr>
</table>
<div align="right" id="searchJustForm">
<fieldset style="font-family:'B Nazanin';font-size:14pt">
@using (Ajax.BeginForm("Index", "Terminal", new AjaxOptions() { UpdateTargetId = "divGomrokJust", InsertionMode = InsertionMode.Replace }))
{
<div align="center">
感謝你們的關注。
HTML中嵌套的'form'元素是非法的。 –