asp.net mvc 2
Controller needs to derive from Mvc.Controller
each controller function is assiaciaed with a default view by name
controller and viewer can exchange data by viewdata
use HTML.ActionLink to add a link on html page
a url is corresponding to a action method
in view, using HTML.BeginForm() will generate <Form></Form>
use AcceptVerb("Post") to get the post HTTP
Strong typed view, with data binding to a data model
use Model.xx to access the members
DataModel class that derives from IDataErrorInfo to add a data valaidation
How to determine is valid and validation summay in data model class?
相关文档:
Page 执行中将按照如下顺序激活事件:
Page.PreInit
Page.Init
Page.InitComplite
Page.PreLoad
Page.Load
Page.LoadComplete
Page.PreRender
Page.PreRenderComplete
如果页面从令一个页面继承,如BasePage:System.Web.UI.Page,在BasePage中做了一些扩展,如权限检查,而其他页面从BasePage继承,则BasePage和最 ......
【摘 要】 本文基于ASP.NET 2.0的源代码,对ASP.NET 2.0运行时进行了简要的分析,希望能帮助你理解ASP.NET 2.0中请求处理过程及页面编译模型。
主要类:
System.Web.HttpRuntime
System.Web.HttpApplicationFactory
System.Web.HttpApplication
System.Web.Compilation.BuildManager
Syst ......
protected void Button3_Click(object sender, EventArgs e)
{
//定义变量,判断是否有图片上传
bool fileIsValid = false;
//如果有图片上传,判断其格式
&nbs ......