【发布时间】:2014-04-10 08:06:59
【问题描述】:
我在 Umbraco 7.1 中劫持了路由,由于某种原因,按下提交按钮时我的 HttpPost 没有触发。关于为什么会这样的任何输入?按下发送时会发生回发,但在 HttpPost 中放置断点时不会触发。
这是我的代码的 sn-p,即控制器后面的标记。
@inherits UmbracoViewPage
@{
Layout = "Layout.cshtml";
}
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.TextAreaFor(m => m.Message)
< i n p u t type="submit" value="Send" />
@Html.ValidationMessageFor(m => m.Message)
</div>
}
public ActionResult Index(ManageMessageId? smess)
{
var errorModel = new ErrorModel();
...
return CurrentTemplate(errorModel);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Index(ErrorModel model)
{
if (ModelState.IsValid)
{
...
}
return View();
}
【问题讨论】:
标签: asp.net-mvc http-post umbraco