如何在显示/启用控件之前检查Session变量是否已完全更新 [英] How to check if Session variable has been fully updated before displaying / enabling a control

查看:47
本文介绍了如何在显示/启用控件之前检查Session变量是否已完全更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个页面显示一个包含搜索结果的网格。如果用户在网格显示后立即单击其中一个网格项,则表示未正确选择该项目并且应用程序被卡住。但是如果用户在
之后等待几秒钟,网格显示选择一个项目,它就可以正常工作。

I have a page that displays a grid with results from a search. If the user clicks on one of the grid items right after the grid displays, the item is not properly selected and the application gets stucked. But if the user waits a couple of seconds after the grid displays to select an item, it works fine.

一开始,我认为网格的selected_index_changed事件是没有开火,但在调试后我发现它正在开火。此外,事实上它发生的是,当网格显示时,Session变量没有完全更新。因此,如果用户等待几秒钟,
,会话变量有足够的时间进行更新并且可以正常工作。

At the beginning, I thought the selected_index_changed event of the grid was not firing but after debugging I found it is firing. Also, what in fact it happening is that by the time the grid gets displayed, the Session variable is not fully updated. So, if the user waits a couple of seconds, it is enough time for the Session variable to update and it works.

这主要发生在Windows 7,IIS7和IE7,IE8,IE9 ......我在Windows XP和IE6以及IE8中进行了相同的测试工作良好。

This happens mostly on Windows 7, IIS7, and IE7, IE8, IE9...I have made the same test in Windows XP and IE6 and IE8 and it works fine.

我需要延迟网格显示以防止用户在页面完全加载和更新Session变量之前单击,或者正确配置OS,IIS和/或浏览器防止这种情况发生。我已尝试将代码放在LoadComplete,
PreRenderComplete和  SaveStateComplete 页面事件上但没有运气。此外,我已经从Session变量更改为ViewState,因为我停留在同一页面但仍然无法解决问题。基本上我需要能够
允许页面上的所有内容完成之前该网格是可见的,用户点击它。

I need to either delay the grid from showing to prevent user from clicking before the page is fully loaded and Session variable updated, or properly configure OS, IIS, and or Browser to prevent this from happening. I have tried putting the code on LoadComplete, PreRenderComplete, and  SaveStateComplete events of the page but no luck. Also I have changed from Session variable to ViewState since I am staying at the same page but it still doesn't solve the problem. Basically I need to be able to allow everything going on with the page to complete before that grid is visible and the user clicks on it.

有什么想法可以触发这个问题以及如何解决它?

Any ideas of what can be triggering this issue and how to solve it?

推荐答案

我建议您将问题发布到其中一个ASP.NET论坛。他们可以更好地回答有关会话状态和网络表单的问题。

I would recommend posting your question to one of the ASP.NET forums. They can probably better answer questions about session state and web forms.

http://forums.asp.net /


这篇关于如何在显示/启用控件之前检查Session变量是否已完全更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆