Home Update div class in foreach loop using partial
Reply: 0

Update div class in foreach loop using partial

user1059 Published in March 24, 2018, 5:44 pm

I want create a blogs list with mvc razor. I have a partial for calling blogs item and a layout as master page. I want using zip layout (first item push to right secondary push to left and reset for next items).


@foreach (var item in Model.Listings)
     @Html.Partial("~/Views/Listing/_ListingCard.cshtml", item)


       <div class="card card-plain card-blog">
        <div class="row">
            <div class="col-md-5">
                <div class="card-image">
            <div class="col-md-7">
                <div class="card-body">

I want change col-md-5 with col-md-7 per loop.
Can I do this without JS? Any idea please?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300183 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO