.net core 2.1 tempdata跨视图传递无效

2019-01-02 21:21发布

                if (result > 0) {
                    TempData["UpdateSuccess"] = true;
                    return RedirectToAction(nameof(Index));
                }

TempData["UpdateSuccess"] 是Null

标签:
1条回答
迷人小祖宗
2楼-- · 2019-01-02 22:10

试试 stackoverflow 上的一个方法

After Migrating to ASP Core 2.1 I had this issue and after working for a day find the solution:
in Startup.Configure() app.UseCookiePolicy(); should be after app.UseMVC();

查看更多
登录 后发表回答