zoukankan      html  css  js  c++  java
  • 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.
     
     
  • 相关阅读:
    滴滴快车奖励政策,高峰奖励,翻倍奖励,按成交率,指派单数分级(2月16日)
    优步UBER司机全国各地奖励政策汇总 (2月15日-2月21日)
    优步UBER司机全国各地奖励政策汇总 (2月8日-2月14日)
    滴滴快车奖励政策,高峰奖励,翻倍奖励,按成交率,指派单数分级(2月7日~2月13日)
    成都Uber优步司机奖励政策(2月7日)
    file does not exist 阿里云OSS图片上传遇到的问题
    redis.conf 配置项说明
    redis 五大数据类型的常用指令
    redis配置外部访问
    linux安装redis
  • 原文地址:https://www.cnblogs.com/etoah/p/4273148.html
Copyright © 2011-2022 走看看