I hijacked a route in Umbraco 7.1, and for some reason my HttpPost doesn't fire when the submit button is pressed. Is there any information on why this is so? When sending a push, a postback occurs, but when setting a breakpoint in HttpPost, it never started.
Here is a snippet of my code, markup followed by a controller.
@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();
}
source
share