@html.DropDowlistFor 和@Html.RadioButton使用

        /// <summary>
        /// 获取dropdowList集合
        /// </summary>
        /// <returns></returns>
        public IEnumerable<SelectListItem> GetSelectList(string user_id,int classId)
        {
            string ClassId = classId.ToString();
            var query = from p in entities.T_Category where p.User_Id == user_id & p.ClassId == classId select p;
            var selectList = query.Select(a => new SelectListItem
            {
                Text = a.ClassName,
                Value = System.Data.Objects.SqlClient.SqlFunctions.StringConvert((double)a.Id)
            });
            return selectList;

        }

定义  IEnumerable<SelectListItem> 得到集合  list_Education

@Html.DropDownListFor(m => m.Education, list_Education, new { @class = "usern-style" })


 @Html.RadioButtonFor(m => m.Type, "全职", new { @name = "gender", @id = "radio1" })
                                        <label for="radio1" style="float: none; display: initial">全职</label>
                                        @Html.RadioButtonFor(m => m.Type, "兼职", new { @name = "gender", @id = "radio2" })
                                        <label for="radio2" style="float: none; display: initial">兼职</label>
                                        @Html.RadioButtonFor(m => m.Type, "临时", new { @name = "gender", @id = "radio3" })
                                        <label for="radio3" style="float: none; display: initial">临时</label>
                                        @Html.RadioButtonFor(m => m.Type, "合作", new { @name = "gender", @id = "radio4" })
                                        <label for="radio4" style="float: none; display: initial">合作</label>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值