Example #1
0
        public static MvcHtmlString GetAllPhoneBoardList(this HtmlHelper htmlHelper, string name, string selectedValue)
        {
            IEnumerable <CommonIDName> group = BaseDataBLL.GetPhoneBoard();

            string option      = "";
            string alloptgroup = "";

            foreach (CommonIDName item in group)
            {
                if (selectedValue == item.Name)
                {
                    option += " <option selected='selected' value = '" + item.Name + "' > " + item.Name + " </option >";
                }
                else
                {
                    option += " <option value = '" + item.Name + "' > " + item.Name + " </option >";
                }
            }



            alloptgroup += option;

            alloptgroup = "<select style = 'width: 100 %;' class='select2' id=" + name + " name=" + name + ">" +
                          "<option value='all_brand'>&nbsp;&nbsp;&nbsp;所有品牌</option>" +
                          alloptgroup +
                          "</select>";
            return(new MvcHtmlString(alloptgroup));
        }