我有一个奇怪的。我试图简单地使用 TextArea 帮助器来呈现标准的 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();
}
在第一次加载页面时,它工作得很好并呈现了 textarea
之前 http://cadred.net/personal/contact-before.png
但是,当我提交表单以测试验证时,它不再呈现 textarea