/// 获取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>