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

推荐订阅源

C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
Jina AI
Jina AI
雷峰网
雷峰网
M
MIT News - Artificial intelligence
小众软件
小众软件
H
Help Net Security
The Register - Security
The Register - Security
T
Tailwind CSS Blog
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
月光博客
月光博客
Project Zero
Project Zero
P
Proofpoint News Feed
S
Security @ Cisco Blogs
L
LINUX DO - 最新话题
I
InfoQ
Vercel News
Vercel News
V
Vulnerabilities – Threatpost
S
Schneier on Security
Spread Privacy
Spread Privacy
Hugging Face - Blog
Hugging Face - Blog
D
Docker
博客园 - 【当耐特】
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
宝玉的分享
宝玉的分享
Recorded Future
Recorded Future
K
Kaspersky official blog
L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
腾讯CDC
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
Schneier on Security
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
B
Blog RSS Feed

博客园 - 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);

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