问题描述
我有一个带有列表框控件的 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 中时未保存会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!