6 回答

TA贡献1821条经验 获得超6个赞
当你点击这个链接的时候,t就已经传到controller里了,直接request["t"]就能得到值。
MVC的链接最好这么写
<a href="<%=Url.Action("index","Home",new { t = x_xj}) %>" target="_parent" >简介</a>

TA贡献1725条经验 获得超7个赞
这是写在.aspx中的,我想通过点这个链接,在页面上显示从数据库中显示的内容。t=x_xj用来判断的。。下面还有好几个<a href="index.aspx?t=......." target="_parent">简介</a>这样不同的链接,不知道怎么把这个t的值传到controller里面

TA贡献1860条经验 获得超8个赞
@Html.ActionLink("点我", "test", new { t = "tttt" })
public ActionResult test(string t)
{ return null; }
或者
protected override void Initialize(RequestContext requestContext)
{
if (requestContext.HttpContext.Request.QueryString["t"] != null)
{
}
base.Initialize(requestContext);
}
- 6 回答
- 0 关注
- 285 浏览
添加回答
举报