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

推荐订阅源

The GitHub Blog
The GitHub Blog
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Vulnerabilities – Threatpost
S
Secure Thoughts
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Threat Research - Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AWS News Blog
AWS News Blog
C
CERT Recently Published Vulnerability Notes
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
腾讯CDC
P
Proofpoint News Feed
小众软件
小众软件
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
L
LINUX DO - 热门话题
人人都是产品经理
人人都是产品经理
罗磊的独立博客
M
MIT News - Artificial intelligence
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
A
About on SuperTechFans
月光博客
月光博客
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
K
Kaspersky official blog
Latest news
Latest news
C
Cisco Blogs
I
Intezer
L
Lohrmann on Cybersecurity
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
P
Privacy International News Feed
Scott Helme
Scott Helme
Google DeepMind News
Google DeepMind News
S
Security @ Cisco Blogs
T
The Blog of Author Tim Ferriss
S
Securelist
PCI Perspectives
PCI Perspectives
V
Visual Studio Blog
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - leohuang

C#日期函数使用大全 replace(/\s/g,"")中的/g是什么意思? 及replace函数的用法 - leohuang - 博客园 Timestamp (rowversion) Data Type 为什么就没有中文版 数据库设计和优化 的书呢 巧用httpModules实现网站域名更换 asp.net 下发布水晶报表调试经验 C#操作Access的一些小结 Photoshop制作Favicon.ico图标(转载) 取消ie6自动打开excel - leohuang - 博客园 oracle多表查询分页 库存出入库算法 Page_Load为什么会执行两次 - leohuang - 博客园 asp网站(asp+access)怎么防注入呢 Windows Service开发日志(转载csdn) 访问母板页的updatepanel 及 设置 密码框字符 - leohuang 垃圾的江苏电信 amd 2500 boot设置 总算下到 Expert C# 2008 Business Objects 了 读《Expert C# 2005 Business Object》
IFrame 下返回登录页
leohuang · 2009-08-06 · via 博客园 - leohuang

因为用了IFrame,所以框架内的页面,如果长时间不操作,再刷新时会返回登录页面。
传统的Response.Redirect(UIHelper.BaseUrl + "LoginPage.aspx");是返回登录页,但用户再登录时,会又产生框架,不是我们想要的。
所以采用javascript判断一下是否有parent,在asp.net 的后端cs文件中,

string scriptString = @"function ToLoginPage(login_page) {
                            try {
                                window.parent.parent.location.href = login_page;
                            } catch (e) {
                                window.parent.location.href = login_page;
                            }
                        }";               
                string login = UIHelper.BaseUrl + "LoginPage.aspx";
                scriptString += "ToLoginPage('" + login + "');";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Startup", scriptString, true);

函数声明和调用要写到一块,分开来还不行。