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 中时未保存会话变量


- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01