Loading

摘要: 分类:ASP Dot Net2008-01-08 11:229258人阅读评论(29)收藏举报 partial关键字 C#2.0提供的新关键字,用来将一个class、struct或interface的定义拆分,写在不同的源文件中。每个源文件包含类定义的一部分,编译应用程序时将把所有部分组合起来。在以下几种情况下需要拆分类定义:1.处理大型项目时,使一个类分布于多个独立文件中可以让多位程序员同时对该类进行处理。2.使用自动生成的源时,无需重新创建源文件便可将代码添加到类中。Visual Studio 在创建 Windows 窗体、Web 服务包装代码等时都使用此方法。无需编辑 Visual St 阅读全文
posted @ 2012-06-05 14:23 青岛欧姆网络科技 阅读(547) 评论(0) 推荐(0) 编辑
摘要: public ActionResult Index(){var albums = storeDB.Albums.Include("Genre").Include("Artist");return View(albums.ToList());}这里写成public ActionResult Index(){var albums = storeDB.Albums;return View(albums.ToList());}运行也一样,显示结果也一样, 也会包含genre和artist不知道两者有什么具体的区别?storeDB.Albums.Include(& 阅读全文
posted @ 2012-06-05 11:02 青岛欧姆网络科技 阅读(509) 评论(0) 推荐(0) 编辑
摘要: ActionResult is an abstract class that can have several subtypes:a) ViewResult - Renders a specifed view to the response streamb) PartialViewResult - Renders a specifed partial view to the response streamc) EmptyResult - An empty response is returnedd) RedirectResult - Performs an HTTP redirection t 阅读全文
posted @ 2012-06-05 09:19 青岛欧姆网络科技 阅读(160) 评论(0) 推荐(0) 编辑