Session Variables not saved when page is in an iFrame(页面位于 iFrame 中时未保存会话变量)
问题描述
我有一个带有列表框控件的 aspx 页面.列表框由页面加载时从服务检索的集合填充.当用户从列表框中选择一个项目时,页面回发,在重新加载之前将检索到的对象添加到会话中.在重新加载时,我使用会话对象而不必再次调用服务.
I have an aspx page with a listbox control. The listbox is populated from a collection that is retrieved from a service when the page loads. When the user selects an item from the listbox the page posts back, adding the retrieved objects to the session before reloading. On the reload I use the session objects instead of having to call the service again.
这一切正常,直到我从 iFrame 中访问该页面.当页面在 iFrame 中时(Session["blah"] 为空),不会检索 Session 对象.当页面不在 iFrame 中时,此代码可以完美运行.
This all works fine until I access the page from within an iFrame. The Session objects are not retrieved when the page is in an iFrame (Session["blah"] is null). This code works perfectly when the page is not in an iFrame.
我正在使用 IIS7 和 windows server 2008.我需要在 ISS 中做些什么来允许在 iFrame 中使用 Session 变量吗?有谁知道可能导致这种情况发生的其他任何事情?
I am using IIS7 and windows server 2008. Is there anything I need to do in ISS to allow Session variables to be used in an iFrame? Does anyone know of anything else that may cause this to happen?
谢谢,尼尔
推荐答案
其实没关系,我只是清除了 C:WindowsMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET 中的文件文件
并重新启动IIS,一切正常
Actually never mind, I just cleared out the files in C:WindowsMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files
and restarted IIS and it was all working
这篇关于页面位于 iFrame 中时未保存会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:页面位于 iFrame 中时未保存会话变量


基础教程推荐
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01