zoukankan      html  css  js  c++  java
  • asp.net mvc View视图相关

    1.0 @helper语法

    @helper语法可以定义可重复使用的帮助器方法: 例如

    @helper methodName(type paramName,...){

      //todo

    }

    调用:@methodName(parma)

    @helper RData(int cate_id, int channel_id)
    {
        var xsmsList = new ArticleService().GetDataTop(new CateModel() { cate_id = cate_id, channel_id = channel_id, haveChild = false }, 
    8);//限时秒杀
        foreach (var item in xsmsList)
        {
            <li>
                <a href="#"><img src="@Keys.GetImgUrlDomainName()@item.img_url" alt=""></a>
                <h3><a href="#">@item.title</a></h3>
                <span>@item.zhaiyao</span>
                <div class="w-jiaGe cl">
                    <div class="jg-left">1524人关注</div>
                    <div class="jg-right">
                        <b>¥</b><strong>@item.sell_price</strong><em>起</em>
                    </div>
                </div>
            </li>
        }
    }
    
    调用: @RData(7,40)
  • 相关阅读:
    template(2.2)
    Filter过滤链条
    The 3n + 1 problem
    Struts2.3+Spring4.0
    康托展开
    templates(2.1)
    templates(1.2)
    templates(1.1)
    我和你
    Android 的上下文菜单: Context Menu
  • 原文地址:https://www.cnblogs.com/ICE_Inspire/p/5390915.html
Copyright © 2011-2022 走看看