如何绑定动态购物车 [英] How to bind dynamic cart

查看:97
本文介绍了如何绑定动态购物车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能指导我如何在ASP.NET MVC中绑定这个购物车



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



提前致谢:)

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 :)

推荐答案

我假设你收集了物品(购物车物品)。将其作为模型传递给查看。并使用类似这样的内容:

I assume you're having collection of items (cart items). Pass it as a model to the View. And use it something like this:
<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 >
< 按钮 class = btn btn-xs btn-danger pull-right > x < / button >
< / span >
< / span >
< / li >
}
}
< / ul >
</span> </span> </span> <span class="item-right"> <button class="btn btn-xs btn-danger pull-right">x</button> </span> </span> </li> } } </ul>





-KR



-KR


这篇关于如何绑定动态购物车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆