welcome to Qijie's Blog 薛其杰
摘要: 当开发MVC应用程序, 使用.NET Entity Framework的Code First model试, 若是需要将model层对象的改动更新进数据库, 需要使用Package Manager Console的控制台。1. Tools -> Library Package Manager -> Package Manager Console2. Enable-Migrations3. Add-Miagration "为此次migration起个名字"4. Update-Database -verbose 阅读全文
posted @ 2014-03-18 17:12 零点零一 阅读(522) 评论(0) 推荐(0)
摘要: MVC中为 DropDownListFor 绑定列表项, 一种方案从后台加载列表内容,通过ViewData传递到前台页面.View: @Html.LabelFor(model => model.CategoryType) @Html.DropDownListFor(model => model.CategoryType, ViewData["Type"] as SelectList) @Html.ValidationMessageFor(model=>model.CategoryT... 阅读全文
posted @ 2014-03-18 14:28 零点零一 阅读(13785) 评论(0) 推荐(1)