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.
 
 

Fundamentals of MVC的更多相关文章

  1. Demystifying ASP.NET MVC 5 Error Pages and Error Logging

    出处:http://dusted.codes/demystifying-aspnet-mvc-5-error-pages-and-error-logging Error pages and error ...

  2. MVC推荐教程和文章列表

    着手Getting Started Getting Started with ASP.NET MVC 5 (共11部分) Pluralsight ASP.NET MVC 5 Fundamentals( ...

  3. ASP.NET Core MVC/WebAPi如何构建路由?

    前言 本节我们来讲讲ASP.NET Core中的路由,在讲路由之前我们首先回顾下之前所讲在ASP.NET Core中的模型绑定这其中有一个问题是我在项目当中遇见的,我们下面首先来看看这个问题. 回顾A ...

  4. [.Net Core] 在 Mvc 中简单使用日志组件

    在 Mvc 中简单使用日志组件 基于 .Net Core 2.0,本文只是蜻蜓点水,并非深入浅出. 目录 使用内置的日志组件 简单过渡到第三方组件 - NLog 使用内置的日志 下面使用控制器 Hom ...

  5. ASP.NET MVC应用迁移到ASP.NET Core及其异同简介

    ASP.NET Core是微软新推出支持跨平台.高性能.开源的开发框架,相比起原有的ASP.NET来说,ASP.NET Core更适合开发现代应用程序,如跨平台.Dorker的支持.集成现代前端开发框 ...

  6. ASP.NET Core 入门教程 3、ASP.NET Core MVC路由入门

    一.前言 1.本文主要内容 ASP.NET Core MVC路由工作原理概述 ASP.NET Core MVC带路径参数的路由示例 ASP.NET Core MVC固定前/后缀的路由示例 ASP.NE ...

  7. .net core 2.0 mvc 获取配置信息

    mvc_core_config *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 ...

  8. sql server 关于表中只增标识问题 C# 实现自动化打开和关闭可执行文件(或 关闭停止与系统交互的可执行文件) ajaxfileupload插件上传图片功能,用MVC和aspx做后台各写了一个案例 将小写阿拉伯数字转换成大写的汉字, C# WinForm 中英文实现, 国际化实现的简单方法 ASP.NET Core 2 学习笔记(六)ASP.NET Core 2 学习笔记(三)

    sql server 关于表中只增标识问题   由于我们系统时间用的过长,数据量大,设计是采用自增ID 我们插入数据的时候把ID也写进去,我们可以采用 关闭和开启自增标识 没有关闭的时候 ,提示一下错 ...

  9. .Net Core MVC理解新管道处理模型、中间件

    .Net Core中间件官网:https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/middleware/?view=aspnetcore ...

随机推荐

  1. Javascript图表插件HighCharts用法案例

    最近还在忙着基于ABP的项目,但本篇博客和ABP无关,喜欢ABP框架的朋友请点击传送门. 这不,最近项目基本功能做的差不多了,现在在做一个数据统计的功能,需要绘制区域图(或折线图)和饼图.一开始,楼主 ...

  2. linux 2.6 驱动笔记(三)

    驱动的并发与应用的并发实现一样,以信号量为例,修改基本字符驱动代码如下: 1. 增加sem定义 struct globalmem_dev{ struct cdev cdev; /*linux 2.6 ...

  3. MySQL3:索引

    什么是索引 索引是对数据库表中一列或者多列的值进行排序的一种结构,所引用于快速找出在某个列中有一特定值的行.不使用索引,MySQL必须从第一条记录开始读完整个表,直到找出相关的行.表越大,查询数据所花 ...

  4. Json序列化之.NET开源类库Newtonsoft.Json的研究

     一.Json简介 JSON(全称为JavaScript Object Notation) 是一种轻量级的数据交换格式.它是基于JavaScript语法标准的一个子集. JSON采用完全独立于语言的文 ...

  5. C#执行外部程序之执行DOS命令和批处理

    在项目开发中,有时候要处理一些文件,比如视频格式的转换,如果用C开发一套算法,再用C#调用,未免得不偿失!有时候调用现有的程序反而更加方便.今天就来说一下C#中如何调用外部程序,执行一些特殊任务. 这 ...

  6. AlwaysON同步的原理及可用模式

    新一代读写分离技术——AlwaysOn 早在SQL Server 2005的时候微软就已经实现了数据库的查询分离技术——发布订阅.但生产库和查询库的同步性能较差,时常出现性能问题,因此在大型生产环境中 ...

  7. [ZigBee] 1、 ZigBee简介

    前言 目前,中国大力推广的物联网是zigbee 应用的主战场,物联网通过智能感知.识别技术与普适计算(我还特意申请了个域名psjs.vip).泛在网络的融合应用,被称为继计算机.互联网之后世界信息产业 ...

  8. 手把手教你用python打造网易公开课视频下载软件1-总述

    写作前面的话:最近准备重温一下算法导论,感谢大网易把MIT算法导论课程全部贴出来,地址为:http://v.163.com/special/opencourse/algorithms.html,在线看 ...

  9. jsp中运用application实现共享留言板功能

    jsp中application的知识点总结: 1.一个Web应用程序启动后,将会自动创建一个application对象,在整个应用程序的运行过程中只有这一个application对象,即所有访问该网站 ...

  10. javascript日常总结

    如何去除掉inline-block元素之间的默认间距 前几天写一个页面 1 2 3 4 div{width:900px;} div li{ display:inline-block; width:30 ...