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 阅读全文
posted @ 2012-03-31 10:33 H辉 阅读(3389) 评论(5) 推荐(2) 编辑
摘要: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 阅读全文
posted @ 2012-03-31 10:21 H辉 阅读(6762) 评论(2) 推荐(1) 编辑