码迷,mamicode.com
首页 > Web开发 > 详细

Html.DropDownListFor练习(2)

时间:2014-08-06 17:52:31      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:blog   http   使用   os   数据   for   ar   html   

下午有做了练习《Html.DropDownListFor练习http://www.cnblogs.com/insus/p/3382575.html 在实现过程中,需要创建一个List<SelectListItem>数据集,如下
bubuko.com,布布扣

或者:
bubuko.com,布布扣


刚才重新温习这个练习,发觉到其实我们不必写这些数据集,直接使用已经存在FruitCategoryEntity.cs类的IEnumerable<FruitCategory> GetAllFruitCategory()数据集也行。
bubuko.com,布布扣


在视图中的Razor语法:
bubuko.com,布布扣

 

  其实Insus.NET所做这些练习,均是与数据库相连接,也是将来在专案中最接近的实现。

Html.DropDownListFor练习(2),布布扣,bubuko.com

Html.DropDownListFor练习(2)

标签:blog   http   使用   os   数据   for   ar   html   

原文地址:http://www.cnblogs.com/lschenblog/p/3894914.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!