RedirectToAction with parameter

后端 未结 14 1582
傲寒
傲寒 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:32

    ....

    int parameter = Convert.ToInt32(Session["Id"].ToString());
    

    ....

    return RedirectToAction("ActionName", new { Id = parameter });
    

提交回复
热议问题