方法有两种

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"]

 上面写的格式不规范应该这样@hml.actionlink("a","index","home",new {id=1,id2=3})

相关文章:

  • 2021-08-08
  • 2021-07-27
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
猜你喜欢
  • 2021-05-20
  • 2021-05-31
  • 2021-06-02
  • 2022-02-25
  • 2021-09-20
相关资源
相似解决方案