惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
Engineering at Meta
Engineering at Meta
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
T
Tailwind CSS Blog
小众软件
小众软件
J
Java Code Geeks
人人都是产品经理
人人都是产品经理
博客园_首页
MyScale Blog
MyScale Blog
博客园 - 聂微东
V
Visual Studio Blog
The Cloudflare Blog
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42

博客园 - a-peng

My post test IE inline edit how to make hidden element actually hide EntityFramework4.1 Mapping Asp.Net Mvc 3.0 Windbg IOC与AOP Custom Date and Time Format Strings group by Year(CreatedDate), Month(CreatedDate) 用sql, entity sql (linq表达式好像挺复杂) asp.net life cycle 编译器错误消息: 类型“System.Data.Objects.DataClasses.EntityObject”在未被引用的程序集中定义。 让IFrame自适应高度 让IE8使用IE7兼容模式运行 - a-peng - 博客园 Visual Studio 2008 Html Designer无法加载 修改SQLServer2008数据表无法提交 jQuery plugin LazyForm定制您的CheckBox Radio和Select [转载] [翻译]在ASP.NET MVC中使用TDD与依赖注入 Asp.Net Mvc使用Ajax.BeginForm上传文件Request.Files始终为empty Asp.Net Mvc Ajax偏方 太疯狂了:Teleport Pro......It's incredible.
OH MY GOD! 我的后台页面都被IE可缓存了。。。
a-peng · 2010-02-06 · via 博客园 - a-peng

无意间发现一个问题。
1、输入: http://demo/admin
2、被重定向到: http://demo/user/login
   正常

3、登录完成回到: http://demo/admin
4、退出完成回到: http://demo
   正常

5、输入: http://demo/admin
    既然正常显示。。。不会被重定向到http://demo/user/login

我在AdminBasePage里的代码如下:

 protected override void OnInit(EventArgs e)
{            
  if (!this.IsAuthenticated)
  {
    this.RedirectToLoginPage();
  }
  else
  {
    base.OnInit(e);
  }
}

加个断点,发现在第5个步骤时根本没有进入OnInit。。。原来被IE浏览器给缓存了,在Firefox下一切正常。

呼,只能加个清缓存的。

Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.Cache.SetNoStore();