zoukankan      html  css  js  c++  java
  • MVC 下拉單數據內容綁定

     #region
            /// <summary>授權範圍自建列表</summary>
            /// <returns></returns>
            public static List<SelectListItem> GetBookSourceSelectList()
            {
                List<SelectListItem> BookSourceSelectList = new List<SelectListItem>();
                BookSourceSelectList.Add(new SelectListItem() { Value = "1", Text = "雄獅旅遊" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "2", Text = "雄獅資訊" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "3", Text = "雄獅通運" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "4", Text = "雄獅杏林事業" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "5", Text = "欣傳媒" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "6", Text = "傑森全球整合行銷" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "7", Text = "雙獅聯合" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "8", Text = "欣聯航" });
                BookSourceSelectList.Add(new SelectListItem() { Value = "9", Text = "其他" });
                return BookSourceSelectList;
            }
            #endregion

    前台調用方法:

    @Html.DropDownListFor(m => m.Book.BookAuditorSource, Model.BookSourceList, "請選擇", new { id = "sel_BookSource", @class = "input-medium", onchange = "GetBookAuditorName()" })

  • 相关阅读:
    Kafka Streams演示程序
    大全Kafka Streams
    简介Kafka Streams
    初识Kafka
    面试常考各类排序算法总结.(c#)
    php程序员的成长之路
    web前端研发工程师编程能力成长之路
    CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3
    【转】OkHttp使用进阶 译自OkHttp Github官方教程
    排序算法一:桶排序
  • 原文地址:https://www.cnblogs.com/qhy1277/p/4686326.html
Copyright © 2011-2022 走看看