c#mvc redirecttoaction传送参数

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wang_kill/article/details/62226964

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);

}

猜你喜欢

转载自blog.csdn.net/wang_kill/article/details/62226964