welcome to Qijie's Blog 薛其杰
03 2014 档案
The name 'Scripts' does not exist in the current context error in MVC
摘要:创建完成ASP.NET MVC4应用程序以后,试着运行其中一个Create页面, 程序报出运行是错误:CS0103: The name 'Scripts' does not exist in the current context问题根源是Create页面是MVC自动创建的, 在自动创建时添加了一段代码:@section Scripts { @Scripts.Render("~/bundles/jqueryval")}解决方法:在VS中打开Package Manager ConsoleTools -> Library Package Manager - 阅读全文
posted @ 2014-03-31 10:51 零点零一 阅读(2630) 评论(0) 推荐(0)
理解聚集索引与非聚集索引
摘要:本文内容转载于 http://www.cnblogs.com/tuyile006/archive/2009/08/28/1555615.html微软的SQL SERVER提供了两种索引:聚集索引(clustered index,也称聚类索引、簇集索引)和非聚集索引(nonclustered index,也称非聚类索引、非簇集索引)…… (一)深入浅出理解索引结构 实际上,您可以把索引理解为一种特殊的目录。微软的SQL SERVER提供了两种索引:聚集索引(clustered index,也称聚类索引、簇集索引)和非聚集索引(nonclustered index,也称非聚类索引、非簇集索... 阅读全文
posted @ 2014-03-19 15:37 零点零一 阅读(295) 评论(0) 推荐(0)
MVC - Code First Migration Command line
摘要:当开发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 零点零一 阅读(523) 评论(0) 推荐(0)
@Html.DropDownListFor 绑定列表项
摘要: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 零点零一 阅读(13786) 评论(0) 推荐(1)
枚举和字符串转换
摘要:public static String convertToString(this Enum eff){ return Enum.GetName(eff.GetType(), eff);}public static EnumType converToEnum(this String enumValue) { return (EnumType) Enum.Parse(typeof(EnumType), enumValue);}post from : http://stackoverflow.com/questions/483794/convert-enum-to-string 阅读全文
posted @ 2014-03-17 16:34 零点零一 阅读(1497) 评论(0) 推荐(0)