首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Global.asax中设置tempdata

从Global.asax中设置tempdata
EN

Stack Overflow用户
提问于 2011-05-04 09:43:47
回答 1查看 1.5K关注 0票数 0

如何从Global.asax中设置诱惑数据?

asp.net-mvc-2

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-05-04 12:21:53

代码语言:javascript
复制
Dictionary<string, object> tempDataDictionary = Context.Session["__ControllerTempData"] as Dictionary<string, object>;
                if (tempDataDictionary == null)
                {
                    tempDataDictionary = new Dictionary<string, object>();
                }
                **tempDataDictionary["TopMessage"] = message;
                tempDataDictionary["FromUnauthorized"] = true;
                HttpContext.Current.Session["__ControllerTempData"] = tempDataDictionary;**
                Server.ClearError();
                Response.Redirect("~/Account/LogOn");
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5881487

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档