RedirectToAction(string actionName, string controllerName, object routeValues)
RedirectToAction("wx", "play", new { id = id,type=type });
wx为方法名 play为controller
参数传送要注意,方法接收的时候要用string的变量,就算是int数字也只能用string来接收,要不然是接收不到的
例如:
public ActionResult wx(string id,string type)
{
int orderId = 0;
int.TryParse(id,out orderId);
}
本文介绍了ASP.NET MVC中RedirectToAction方法的使用方式,包括如何通过该方法进行页面跳转,并传递参数。文章特别强调了参数传递时需要注意的数据类型转换问题。
847

被折叠的 条评论
为什么被折叠?



