Thursday 26 October 2017

MVC - Fix issue when post back in not executed

Watch this example on YouTube


To fix it replace (in view)

  @Html.TextBoxFor(x=>x.Qty)
    @Html.ValidationMessageFor(x => x.Qty)
    <input type="submit" />

With

@using (Html.BeginForm(null, null, FormMethod.Post)) {
    @Html.TextBoxFor(x=>x.Qty)
    @Html.ValidationMessageFor(x => x.Qty)
    <input type="submit" />
}

No comments:

Post a Comment