Answer the question
In order to leave comments, you need to log in
Ajax.BeginForm not properly generating Action?
There is a form for adding goods to the cart:
@using (Ajax.BeginForm("AddCart","Cart" , new AjaxOptions { UpdateTargetId = "res" }, new { style = "margin-top: 20px" }))
{
<div class="text-center">
@Html.HiddenFor(r => r.Id)
<input type="submit" class="btn btn-for-product" value="Добавить в корзину" />
</div>
}
<form action="/Products/AddCart?Length=4" data-ajax="true" data-ajax-mode="replace" data-ajax-update="#res" id="form0" method="post" style="margin-top: 20px" novalidate="novalidate"> <div class="text-center">
<input data-val="true" data-val-number="Значением поля Id должно быть число." data-val-required="Требуется поле Id." id="Id" name="Id" type="hidden" value="24">
<input type="submit" class="btn btn-for-product" value="Добавить в корзину">
</div>
</form>
Answer the question
In order to leave comments, you need to log in
Need:
@using (Ajax.BeginForm("AddCart", "Cart", null, new AjaxOptions { UpdateTargetId = "res" }, new { style = "margin-top: 20px" }))
{
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question