MVC学习笔记一:基础知识

ASP.NET MVC的组件协作

(1)URL Routing

根据程序中制定的规则从URL中: 根据程序中制定的规则从URL中:
–确定Controller名
–确定Action名
–生成其余各种参数
{controller}/{action}/{year}/{month}/{day}/{id}

  Article/Show/2008/4/10/13456
(2)Controller & Action Executing

根据每一次Request的URL都可以确定:
– Controller(类)

– Action(方法)
Action中执行表现逻辑——操作Model,获取数据,选择View,etc.
Action执行之后将返回—个ActionResult

–使用view生成HTML

–页面跳转

(3)View Rendering

ViewEngine可替换
默认使用aspx ascx master

MvcContrib提供了额外4种ViewEngine
http://www.CodePlex.com/MvcContrib

 

 

posted @ 2010-08-28 23:43  aito  阅读(358)  评论(0编辑  收藏  举报