RedirectToAction with parameter

后端 未结 14 1875
傲寒
傲寒 2020-11-22 08:56

I have an action I call from an anchor thusly, Site/Controller/Action/ID where ID is an int.

Later on I need to redirect to th

14条回答
  •  暖寄归人
    2020-11-22 09:33

    //How to use RedirectToAction in MVC
    
    return RedirectToAction("actionName", "ControllerName", routevalue);
    

    example

    return RedirectToAction("Index", "Home", new { id = 2});
    

提交回复
热议问题