zoukankan      html  css  js  c++  java
  • MVC 知识点学习2

    1、_Layout.cshtml   @RenderBody()

    2、自定义扩展HtmlHelper(需要添加Bootstrap.js或者Bootstrap.min.js文件到项目中)

    namespace System.Web.Mvc.Html //Mvc4Bootstrap.App_Start
    {
      public static class ButtonHelper
      {
          //public static MvcHtmlString Button(string caption,string style,string size)
          //{
          // return new MvcHtmlString("<button type="button" class="" + style + " btn-"+size+"" >" + caption + "</button>");
          //}
           public static MvcHtmlString Button(this HtmlHelper helper,string caption, string style, string size)
           {
                  return new MvcHtmlString("<button type="button" class="" + style + " btn-" + size + "" >" + caption + "</button>");
           }
       }
    }

     调用时@Html.Button("按钮","stylename","sizename")

    3、MVC+Bootstrap下拉框

    <div class="form-group">
    @*Bootstrap下拉框*@
    <div class="col-md-10">
    <div id="territorydropdown" class="dropdown">
    <button id="territorybutton" class="btn btn-sm btn-info" data-toggle="dropdown">显示方式</button>
    <ul id="territories" class="dropdown-menu">
    @*@foreach (var item in ViewBag.TerritoryId)
    {*@
    <li><a href="#" tabindex="-1" data-value="value">单选</a></li>
    <li><a href="#" tabindex="-1" data-value="value">多选</a></li>
    @*}*@
    </ul>
    </div>
    </div>
    </div>

  • 相关阅读:
    Map的两张遍历方法 keySet(),entrySet()
    http://localhost:8080请求用户名和密码。信息为:“XDB” 解决办法
    redis 集群出现的错误
    通信 缩略词
    redis
    hadoop 概念
    mysql 集群的一些概念
    SQL 基本关键字 函数 关联 连接
    JAVA集合
    SQL.Cookbook 读书笔记5 元数据查询
  • 原文地址:https://www.cnblogs.com/yhhdream/p/4454157.html
Copyright © 2011-2022 走看看