您的位置:首页 > 编程语言 > C#

c#mvc redirecttoaction传送参数

2017-03-15 15:44 393 查看
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);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: