Part 2 How are the URL's mapped to Controller Action Methods?
2015-10-05 17:36
555 查看
Part 2 How are the URL's mapped to Controller Action Methods?
The answer is ASP.NET Routing.Notice that in Global.asax we have RegisterRoutes().
and press F12 go to the defination of this Method.
ASP.NET MVC will automatically pass any query string or form post parameters named "name" to index action method when it is invoked.
The answer is ASP.NET Routing.Notice that in Global.asax we have RegisterRoutes().
and press F12 go to the defination of this Method.
ASP.NET MVC will automatically pass any query string or form post parameters named "name" to index action method when it is invoked.
public string Index(string id,string name) { return "Id="+id+" Name="+name; } public string Index(string id) { return "Id="+id+" Name="+Request.QueryString["name"]; }
相关文章推荐
- Android学习笔记之游标访问SQLite数据
- 我想要的iOS平台开发环境
- android 处理空listview
- Matlab-vision包学习-Object Detection and Recognition-ocr函数字符识别
- iOS开发UI篇—程序启动原理和UIApplication
- iOS 开发之缓存清除
- code signing is required for product type 'Application' in SDK 'iOS 9.0'错误
- Trending repositories(iOS的趋势存储库)
- iOS 清理缓存方法
- Unity5中lightmap的坑
- iOS9的新特性
- android--窗口去掉标题栏和状态栏
- 2.Swift 类和接口详解
- 1.Swift 基础语法
- java 微信与支付宝退款接口开发总结
- 实现android gif图片动画播放功能
- iOS中的三种定时器使用方法
- 笔记:学习 Android-BroadcastReceiver
- cocos代码研究(6)有限时间动作类(FiniteTimeAction)学习笔记
- Swift和OC代码注释分析 #pragma mark, FIXME and TODO