积极答复者
ie6如何解决弹出窗口Session的值为空的问题

问题
答案
-
你好,
在IE6之前的老版本,因为弹出窗口有可能是在不正确的iexplore进程里生成的,所以会有Session丢失的情况。这个问题在IE6及以后的版本中已经解决,我建了两个简单的页面,确认在IE6下弹出的窗口是否有产生Session丢失的问题。
主页面:default.aspx
<script language="javascript">
function windowOpen()
{window.open("another.aspx","_blank");}
</script>
<a href="javascript:windowOpen();">Link</a>
<BR>
The seesion Id=<%=Session.SessionID%>
<BR>
<% Session("test")="Assigned this value for testing" %>
Session("test")=<%=Session("test")%>弹出页面: another.aspx
The Session Id=<%=Session.SessionID%>
<BR>
Session("test")=<%=Session("test")%>在页面another.aspx内仍然能够读取到Session("test")的值。你可以把你的代码贴在这里,这样的话可以方便我们重现你的问题。
谢谢!
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 m s 2011年1月5日 6:14
全部回复
-
你好,
在IE6之前的老版本,因为弹出窗口有可能是在不正确的iexplore进程里生成的,所以会有Session丢失的情况。这个问题在IE6及以后的版本中已经解决,我建了两个简单的页面,确认在IE6下弹出的窗口是否有产生Session丢失的问题。
主页面:default.aspx
<script language="javascript">
function windowOpen()
{window.open("another.aspx","_blank");}
</script>
<a href="javascript:windowOpen();">Link</a>
<BR>
The seesion Id=<%=Session.SessionID%>
<BR>
<% Session("test")="Assigned this value for testing" %>
Session("test")=<%=Session("test")%>弹出页面: another.aspx
The Session Id=<%=Session.SessionID%>
<BR>
Session("test")=<%=Session("test")%>在页面another.aspx内仍然能够读取到Session("test")的值。你可以把你的代码贴在这里,这样的话可以方便我们重现你的问题。
谢谢!
Leo Tang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 m s 2011年1月5日 6:14