首页 > Web开发 > 详细

在MVC的cshtml视图页获取默认路由下的ID值的方法

时间:2015-09-06 12:29:34      阅读:316      评论:0      收藏:0      [点我收藏+]
 <a href="/user/resume/index/11">
   <span class="title bold">我的 @Request.RequestContext.RouteData.Values["id"]</span>
 </a>

如上代码如果想取最后的ID值11,只要如下做就行了:

@Request.RequestContext.RouteData.Values["id"]

没有路由则直接用@Request.QueryString["id"]

在MVC的cshtml视图页获取默认路由下的ID值的方法

原文:http://www.cnblogs.com/firstcsharp/p/4785083.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!