對話內容ASP.NET MVC3 jQuery的對話框驗證摘要錯誤顯示?
<div id="div_dialog_container" class="dialog_container">
@using (Html.BeginForm((string)ViewBag.FormAction, "Musteri"))
{
<div id="div_iu_form_container" class="ui_form_container">
<div>@Html.ValidationSummary(true, "Müşteri Kaydı Başarısız! Lütfen Bilgileri Kontrol Ediniz.")
</div>
<table>
<thead>
<tr>
<th colspan="2">Genel Bilgiler</th>
</tr>
</thead>
<tbody>
<tr>
<td>@Html.LabelFor(x => x.musteri_no):</td>
<td>@Html.TextBoxFor(x => x.musteri_no)
@Html.ValidationMessageFor(x => x.musteri_no)</td>
</tr>
<tr>
<td>@Html.LabelFor(x => x.musteri_adi):</td>
<td>@Html.TextBoxFor(x => x.musteri_adi)
@Html.ValidationMessageFor(x => x.musteri_adi)</td>
</tr>
<tr>
<td>@Html.LabelFor(x => x.sektor):</td>
<td>@Html.TextBoxFor(x => x.sektor)
@Html.ValidationMessageFor(x => x.sektor)</td>
</tr>
</tbody>
<tfoot></tfoot>
</table>
控制器
[HttpPost]
public JsonResult JsonMusteriDuzenle(TblMusteriler musteri, string returnUrl)
{
if (ModelState.IsValid)
{
try
{
mus_dbo.update_musteri(musteri);
return Json(new { success = true, redirect = returnUrl });
}
catch (Exception e)
{
ModelState.AddModelError("", "Müşteri güncelleme hatası.");
}
}
return Json(new { errors = GetErrorsFromModelState() });
}
我想顯示錯誤文本框的BUTTOM。但它顯示在頂部是這樣的:
我怎麼能顯示每個錯誤自己的文本框的BUTTOM?
我想這一點:
感謝。
JsonResult和partialView(類型不匹配) – 2012-07-09 09:56:55
回答更新。你的動作簽名必須使用'ActionResult'作爲返回類型。 – 2012-07-09 09:57:26