the card Html.RenderPartial("IBDCommerce/IBDeCommerceElements/IBDProductCard", product); his this piece of code in it which is the section that gives the issue.
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3">
.......
using (Html.BeginUmbracoForm("SiteWideAddToBasket", "IBDCommerceStore", new { @class = "form", role = "form" }))
{
<input type="hidden" id="productId" name="productId" value="@Model.Id" />
<input type="hidden" id="variatKey" name="variatKey" value="@Model.ProductVariant.FirstOrDefault().Key" />
<button class="btn btn-add-to-cart active mb-3 me-2 bg-gradient-green btn-bold" id="[email protected]" type="submit">
Add To Cart
</button>
}
.......
</div>
when rendering with pagination ie inside the ajax form the very first card and only the first card triggers the pagination controller routine rather than the add to cart routine. all other cards work correctly.
my first comment would be that you can't nest forms which when you have pagination on you appear to be doing, you need the pagination form to be outside of your form rather than your card forms nested inside the pagination form.
so your Ajax.BeginForm should only contain your navigation code and not the foreach loop that renders your cards
Umbraco8 Html.BeginUmbracoForm rendering the first element different.
Using Umbraco8
I have a Partial view that renders a heap of product cards (each card is rendered by another partial view).
the first partial view (parent partial view can be rendered with pagination or not.
if not pagination
if pagination
so first obvious deference is on is an ajax form
the card Html.RenderPartial("IBDCommerce/IBDeCommerceElements/IBDProductCard", product); his this piece of code in it which is the section that gives the issue.
when rendering with pagination ie inside the ajax form the very first card and only the first card triggers the pagination controller routine rather than the add to cart routine. all other cards work correctly.
the rendered html should look like this
however it renders missing the
Any helpers would be appreciated. This is for the first button on the page. This code is repeated in a loop 36 times.
The
my first comment would be that you can't nest forms which when you have pagination on you appear to be doing, you need the pagination form to be outside of your form rather than your card forms nested inside the pagination form.
so your Ajax.BeginForm should only contain your navigation code and not the foreach loop that renders your cards
is working on a reply...