码迷,mamicode.com
首页 > Web开发 > 详细

asp.net mvc 之获取地址栏参数

时间:2015-09-19 12:13:22      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:

方法有两种

test1的view页面

@html.actionlink("参数传递","test2/1","html")

1在test2 的controller中获取

public ActionResult test2(int id)
{
ViewData["id"] = id;

return View();
}

2在test2的view 中获取

@html.viewcontext.routedata.values["id"]

 

asp.net mvc 之获取地址栏参数

标签:

原文地址:http://www.cnblogs.com/dh2014/p/4821125.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!