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?
本文介绍了ASP.NET MVC的基本概念,包括控制器如何从Mvc.Controller派生、默认视图的关联方式、控制器与视图间的数据传递机制等。此外还讲解了如何使用HTML辅助方法生成链接和表单,以及如何通过模型绑定实现强类型视图。
951

被折叠的 条评论
为什么被折叠?



