Fundamentals of MVC

 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.
 
 

转载于:https://www.cnblogs.com/etoah/p/4273148.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值