I want to iterate two columns in a row ...
@Html.Partial("_MediumProductWrap", product)
is a column
@foreach (var product in Model.Products)
{
<div class="row">
@Html.Partial("_MediumProductWrap", product) // Col
</div>
}
Please try the following:
<div class="flex">
<div class="row">
@foreach (var product in Model.Products)
{
<div class="col-6">
@Html.Partial("_MediumProductWrap", product) // Col
</div>
}
</div>
</div>
The bootstrap grid system uses a 12 column grid, so setting the div around your partial to have col-6 will make the products display as a grid with 2 columns.
col-6, which will cause them to appear as two columns (presuming that you're using bootstrap).col-6class to the partial. Please see the following to understand how the Bootstrap grid system works: getbootstrap.com/docs/4.1/layout/grid