asp.net 怎么安全退出问题

julor 2010-01-02 08:13:26
退出登录后,我先销毁session对象,然后跳转到登录界面,但是后退会还能回到刚才登录进出的页面,如果再刷新些页面就要重新登录了,这个问题怎么解决啊?
还有个问题,我用Response.Write("<script language=javascript>alert(\"成功!\");</script>")后,我刚才的居中排列的界面会变成靠左,这个过程由一个按纽的单击事件触发的.这又是为什么呢?
...全文
115 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
julor 2010-01-02
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 wuyq11 的回复:]
Response.Write会破坏页面样式
ClientScript.RegisterStartupScript(this.GetType(), "message", " <script language='javascript' defer>alert(''); </script>");
FormsAuthentication.SignOut();
Session.Clear();
Session.Abandon();
防止后退
<META content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>

Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.Expires = 0;
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
Response.AddHeader("pragma", "no-cache");
Response.CacheControl = "no-cache";

[/Quote]
这个在IE下可以,但在火狐下就不行了.为什么呢?我还试过 Response.Write("<script language=javascript>alert(\"成功退出!\");window.location.href='comlogin.aspx'</script>");
但是在FF下也不行
wuyq11 2010-01-02
  • 打赏
  • 举报
回复
Response.Write会破坏页面样式
ClientScript.RegisterStartupScript(this.GetType(), "message", "<script language='javascript' defer>alert('');</script>");
FormsAuthentication.SignOut();
Session.Clear();
Session.Abandon();
防止后退
<META content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>

Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.Expires = 0;
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
Response.AddHeader("pragma", "no-cache");
Response.CacheControl = "no-cache";
koukoujiayi 2010-01-02
  • 打赏
  • 举报
回复
用Response.Write会破坏格式!!

Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "alert('成功!');", true);

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧