03 2012 档案
摘要:1 查找DropDownListFor要绑定的数据源IEnumerable<NewsType> newsTypeList = (from m in db.NewsType select m).ToList();//从数据库中查找数据。SelectList slist = new SelectList(newsTypeList, "TypeId", "TypeName");//将查找出来的数据,转化为列表对象ViewData["List"] = slist;//使用ViewData对象保存列表对象,在页面控件绑定时用到Vie
阅读全文
摘要:1 进行初始化<%=Html.RadioButtonFor(model => model.TypeState, 0, new { @id = "radio2", @name = "rdolstState" })%>启用 <%=Html.RadioButtonFor(model => model.TypeState, 1, new { @id = "radio1", @name = "rdolstState",@checked=true })%>禁用注意:htmlAbrritbut
阅读全文