[源码下载]
返璞归真 asp.net mvc (3) - Controller/Action
作者:webabcd
介绍
asp.net mvc 之 Controller 和 Action
- Controller 类必须以字符串 "Controller" 做类名称的结尾,字符串 Controller 之前的字符串为 Controller 的名称,类中的方法名为 Action 的名称
- Action 可以没有返回值。如果 Action 要有返回值的话,其类型必须是 ActionResult
示例
1、Controller/Action
ControllerDemoController.cs
2、Get 方式和 Post 方式调用 Controller 的 Demo
GetDemo.aspx
3、处理 JSON 的 Demo
JsonDemo.aspx
4、上传文件的 Demo
UploadDemo.aspx
OK
[源码下载]