protected
void
Application_BeginRequest(
object
sender, EventArgs e)
2
{
3
Application[
“
urlold
“
]
=
Application[
“
url
“
];
4
if
(Request.RawUrl.ToUpper().Contains(
“
.ASPX
“
))
5
{
6
if
(
!
Request.RawUrl.ToUpper().Contains(
“
DEFAULT.ASPX
“
))
7
Application[
“
url
“
]
=
Request.RawUrl;
8
}
9
10
}
11
框架页的page_load里加入如下代码即可:
if
(Application[
“
urlold
“
]
!=
null
)
2
{
3
if
(Application[
“
urlold
“
].ToString().ToLower()
!=
“
default.aspx
“
)
4
lit1.Text
=
“
<script>window.parent.frames[\
“
mainFrame\
“
].location.href=\
“”
+ Application[
“
urlold
“
] +
“
\
“
</script>
“
;
5
}
不算复杂,实现这个效果也可以用cookie,完全通过客户端来实现,也是不错的。偷懒,就用application了。经测试没啥问题
转载于:https://www.cnblogs.com/sdytzz/archive/2010/06/12/1756883.html
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/110763.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...