随笔分类 -  MVC

MVC教程 索引
摘要:原文:http://www.cnblogs.com/zhw511006/archive/2009/12/06/1617956.html1.MVC教程首页http://www.asp.net/learn/mvc/?lang=cs2.MVC概况2.1创建一个基于数据库的"电影"web应用http://www.asp.net/learn/mvc/tutorial-21-cs.aspx2.2MVC执行过程http://www.asp.net/learn/mvc/tutorial-22-cs.aspx2.3理解Models(模型),View(视图),Controllers(控制器)h 阅读全文

posted @ 2012-12-01 16:21 imihiro 阅读(390) 评论(0) 推荐(0)

C# 语言特性(继承)
摘要:(1)只能继承1个基类, 可继承多个接口 阅读全文

posted @ 2012-07-13 16:39 imihiro 阅读(157) 评论(0) 推荐(0)

MVC EF 建立表关联, 关联查询实现
摘要:例1:>Model中体现1对多>DbContext两个表都已声明>Controller中使用Include("表名")即可//效果示意:例2:显示Album表字段 关联到 Genre和Artist字段 阅读全文

posted @ 2012-07-13 11:29 imihiro 阅读(21000) 评论(2) 推荐(2)

C# Keyword(base,protected, override,....)
摘要:(1)protected The protected keyword is a member access modifier. A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member. //proteted修饰的方法 (本类 和 派生类 内部可访问)class A { protected int x = 123;}class B : A {.. 阅读全文

posted @ 2012-07-13 08:51 imihiro 阅读(844) 评论(0) 推荐(0)

MVC Music Sotre -2
摘要:七、使用EF快速完成CRUD功能(1)新建Artist,Genre,Album3个类,用属性显示3张表的关联(2)添加DbContext类(对应数据库),添加DbSet<Model>(对应表)>画出数据库设计图(表、表间关系),手动、UML、SQL的工具均可>添加Album、Genre、Artist类,和DbContext类 public class DbMusicContext:DbContext //相当于数据库 { public DbSet<Album> Albums { get; set; } //Album表 public DbSet<Gen 阅读全文

posted @ 2012-07-13 08:22 imihiro 阅读(2452) 评论(0) 推荐(0)

MVC Music Store
摘要:一、Url映射到Controller ActionResult(Method)(1)添加StoreController public class StoreController : Controller { // // GET: /Store/ //public ActionResult Index() //{ // return View(); //} public string Index(string name) //... 阅读全文

posted @ 2012-07-12 21:29 imihiro 阅读(1120) 评论(0) 推荐(0)

为何断点不停 Application_Start()方法
摘要:原因:启动调试Development Server已经启动。解决方式:停止右下角的Development Server,重新生成. F5 阅读全文

posted @ 2012-07-10 06:09 imihiro 阅读(626) 评论(0) 推荐(0)

MVC Tutorial Movie DIY
摘要:Razor cshtmlRazor cshtmlRazor即cshtml,是MVC的视图设计引擎.view 目录下的 _ViewStart.cshtml @{ Layout = "~/Views/Shared/_Layout.cshtml";}指定模板页 (即把_Layout.cshtml作为母页)sample列表>MovieStorehttp://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-model(3)index.cshtml (显示列表的Razor页)> 阅读全文

posted @ 2012-07-08 10:49 imihiro 阅读(971) 评论(0) 推荐(0)

MVC vs Aspx
摘要:http://weblogs.asp.net/shijuvarghese/archive/2008/07/09/asp-net-mvc-vs-asp-net-web-form.aspx 阅读全文

posted @ 2012-07-07 23:43 imihiro 阅读(206) 评论(0) 推荐(0)

Razor cshtml页面 的 特性
摘要:http://blog.joycode.com/scottgu/archives/2010/07/20/116030.joyRazor 开发者 介绍Razor的特性 阅读全文

posted @ 2012-07-07 16:12 imihiro 阅读(297) 评论(0) 推荐(0)

IIS7 MVC网站生成、发布
摘要:(1)生成。 确保System.Web.Mvc.dll在bin目录下(2)发布网站到文件系统(3)在IIS中为网站添加应用程序池(一个虚拟目录,一个应用程序池)(4)添加在默认网站下添加虚拟目录(5)转换为应用程序至此,部署完毕 阅读全文

posted @ 2012-07-07 09:29 imihiro 阅读(14512) 评论(1) 推荐(0)

MVC 4 教程
摘要:MVC4 前件:visual studio10 sp1http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4(by Rick Anderson)Music Store (byJon Galloway)http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-1http://ofps.oreilly.com/titles/9781449320317/ch_Intro.html(600P 阅读全文

posted @ 2012-07-06 15:43 imihiro 阅读(1011) 评论(0) 推荐(0)

Entity Framework 常用类
摘要:(1)DbContext (Entity FrameWork 5.0)(数据库的CRUD操作)(2)DbSet Represents a typed entity set that is used to perform create, read, update, and delete operations. DbSet is not publicly constructible and can only be created from a DbContext instance. (表的CRUD操作) 阅读全文

posted @ 2012-07-06 14:26 imihiro 阅读(334) 评论(0) 推荐(0)