摘要:
MVC中生成web.config默认只添加了linq的程序集引用,如果使用entity framework(EF)做为MVC的ORM,则需要在webconfig中添加程序集引用:如:<assemblies> ...... <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data.Linq, Version=3.5.0.0, Culture= 阅读全文
posted @ 2011-04-24 18:42
露水丛生
阅读(1456)
评论(0)
推荐(0)
摘要:
在判断ViewData[""]是否为空时,需将ViewData[""]转换为相应的类型,在判断其Count()属性是否为0,来判断是否存有值如:<% if ((ViewData["subDepartmentsAndAmount"] as Dictionary<YouXieKu.Models.Department, int>).Count()!=0){ %>而不能 直接通过 ViewData["subDepartmentsAndAmount"]!=null 抑或 (ViewData[" 阅读全文
posted @ 2011-04-24 14:01
露水丛生
阅读(1106)
评论(0)
推荐(0)
浙公网安备 33010602011771号