Chapter 1 Fundamentals of MVC 
 
Microsoft's Web Development Platforms
Understanding the past can be a big help in appreciating the present.
 
1.ASP
asked for features such as improved code reuse,better separation of concerns,and easier application of object-oriented programming principles.
 
2. ASP.NET Web Forms
an abstraction from the underlying HTML,Js,and Css
 
3.ASP.NET MVC 
The Architecture encourages strict isolation between the individual parts of application.
Benefits:
    Development:Isolated componensts;
    Testability;
    Maintenance.
        
 
 
The MVC Architecture
The model repesents core business logic and data.
The view is responsible for transforming  a model or models into a visual representation.
The Controller is the coordinator between the view and the model.
 
The new in asp.net mvc 4
Async Controllers:just like node.js?
Display modes:different devices.
Bundling and minification:script and css combining and minification.
Web API:supply data to the different platform.
 
 
Convention over Config
 
Action Results

Content() :string

File():file e.g.,a pdf
HttpNotFound() :404
Javascript():js
Json()
PartialView() :without layout
Redirect():302
RedirectPermanent
View()
 
Action Filters
create own filters by extending the ActionFilterAttribute
 
Views
 
Code nuggets
    rendered inline. like this: @Html.ActionLink("Login", "Login")
Code blocks
    like this:@{}
 
Layouts
    layouts like this:
    
 
    content like this:
 
        
 
 
Partial Views
Displaying Data
      It  is the controller’s job to be the “traffic cop,” coordinating various parts of the system to         execute the application’s logic.
 
    ViewData , 
    TempData,
    ViewBag(dynamic) 
    View model(Strongly typed).
 
HTML and URL Helpers
 
HtmlHelper :helps you generate HTML markup
UrlHelper     :helps you generate URLs.
 
 
Models
    
 
 
Putting It All Together
 
As a recap, every ASP.NET MVC request requires at least three things: a route, a controller action, and a view (and, optionally, a model).
    
 
The Route
    
 
 
The Summary
 
ASP.NET MVC leverages the time-tested Model-View-Controller architecture pattern to provide a website development framework that encourages loosely coupled architecture and many other popular object-oriented programming patterns and practices.
 
 

最新文章

  1. 基于ionic+angulajs的混合开发实现地铁APP
  2. Oracle Database 创建HR模式
  3. Centos5.8 安装 MySQL5.6.19
  4. 30行代码实现Javascript中的MVC
  5. Kindle 转换器
  6. Ioc-Autofac的使用
  7. 【BZOJ】【1202】【HNOI2005】狡猾的商人
  8. var隐式类型
  9. asp.net 备份和恢复数据库
  10. Jquery案例——某网站品牌列表的效果
  11. bzoj(矩阵快速幂)
  12. 团队项目汇总beta
  13. mysql远程连接缓及缺少*.dll文件解决方案
  14. ubuntu下 将证书导入java的cacerts证书库
  15. 【新特性】JDK1.9
  16. iOS 九宫格解锁
  17. Maccms8.x 命令执行漏洞分析
  18. 多线程(Thread,Runnable)
  19. 第36-37 Tomcat & SVN
  20. python操作txt文件中数据教程[1]-使用python读写txt文件

热门文章

  1. Websocket全讲解。跨平台的通讯协议 !!基于websocket的高并发即时通讯服务器开发。
  2. Linux 数组
  3. common-dbcp2数据库连接池参数说明
  4. Redis服务器的启动过程分析
  5. How Google TestsSoftware - Crawl, walk, run.
  6. 新手入门:史上最全Web端即时通讯技术原理详解
  7. python 反射的使用
  8. SVN更改登录用户
  9. Sublime Text2 Jsformat自定义使用之代码折叠方式修改
  10. IO流-ZIP文档