私は奇妙なものを持っています。TextArea ヘルパーを使用するだけで、標準のテキストエリアをレンダリングしようとしています。
<p>
<label for="Message">Message:</label>
${ Html.TextArea("IssueText") }
${ Html.ValidationMessage("IssueText", "*") }
</p>
そして私のコントローラー
public ActionResult Contact() {
return View();
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Contact(FormCollection form) {
Seller user = _session.AuthenticatedSeller;
ServiceTicket ticket = new ServiceTicket(user, form["IssueText"],
form["ContactReason"]);
if (ticket.IsValid) {
_servicetTicketRepository.Add(ticket);
_servicetTicketRepository.Commit();
return RedirectToAction("Index", "MyPlace");
}
ModelState.AddModelErrors(ticket.GetRuleViolations());
return View();
}
そして、ページの最初のロードでは、問題なく動作し、テキストエリアをレンダリングします
前 http://cadred.net/personal/contact-before.png
ただし、検証をテストするためにフォームを送信すると、テキストエリアがレンダリングされなくなります