keep viewdata on RedirectToAction

后端 未结 5 1600
深忆病人
深忆病人 2021-02-01 01:40
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult CreateUser([Bind(Exclude = \"Id\")] User user)
{
        ...
        db.SubmitChanges();
        ViewData[\"info\"] = \         


        
5条回答
  •  走了就别回头了
    2021-02-01 02:25

    Use ViewData if your data should be accessible in View during "this" request. Use `TempData' if your data is for "next" request (for example POST-REDIRECT-GET design pattern).

提交回复
热议问题