Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can you guide me how to Bind this cart in ASP.NET MVC

http://bootsnipp.com/snippets/featured/bootstrap-navbar-cart-dropdown[^]

Thanks in advance :)
Posted

1 solution

I assume you're having collection of items (cart items). Pass it as a model to the View. And use it something like this:
HTML
<ul class="dropdown-menu dropdown-cart" role="menu">
@{
    foreach(var item in Model)
    {
              <li>
                  <span class="item">
                    <span class="item-left">
                        <img src="@item.ProductImgURL" alt="" />
                        <span class="item-info">
                            <span>@Model.ProductName</span>
                            <span>@Model.ProductPrice $</span>
                        </span>
                    </span>
                    <span class="item-right">
                        <button class="btn btn-xs btn-danger pull-right">x</button>
                    </span>
                </span>
              </li>
    }
}
</ul>


-KR
 
Share this answer
 
v2
Comments
anil_bang0011 19-Oct-15 1:07am    
Might be but not sure it will work , i think on click bind the model . like you provide

I will try this ..Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900