带有父/子窗口的 ASP.NET Web 应用程序父超时,无法识别子窗口中的使用

发布于 2024-09-16 14:38:58 字数 287 浏览 1 评论 0原文

我编写了一个 Jquery 函数,它会在一定时间不活动后关闭屏幕,创建一个弹出窗口,允许用户单击按钮以保持登录状态,然后将其注销(关闭应用程序窗口)如果他们没有及时回应。

从技术上讲,我们不使用母版页,但我们确实有一个父页面,其中包含页眉、页脚和导航,并且从该窗口调用我的 Jquery 代码。

我的问题是,如果在子窗口中工作,则父窗口无法识别系统正在使用,并且会在分配的时间自动参与。

我知道它不存在,但我想我正在寻找 window.child.settimeout 或类似的东西。预先感谢您的时间和任何想法。

I've got a Jquery function that I wrote which blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time.

We don't technically use master pages, but we do have a parent page in which our header, footer and nav reside, and my Jquery code is called from that window.

My problem is that if one is working in a child window, the parent window doesn't recognize that the system is in use, and will automatically engage at the allocated time.

I know it doesn't exist, but I guess I'm looking for a window.child.settimeout or something like that. Thanks in advance for your time and any ideas.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心凉 2024-09-23 14:38:58

只需让您的子窗口向父窗口报告其活动即可。

在父窗口中,添加一个函数:

    window.reportChildActivity = function() {
        resetLogoffTimer();
    };

然后在子窗口中,调用该函数:

    window.parent.reportChildActivity();

每当检测到用户的活动时。

Simply have your child window report it's activity to the parent window.

In the parent window, add a function:

    window.reportChildActivity = function() {
        resetLogoffTimer();
    };

And then in the child window, call that function:

    window.parent.reportChildActivity();

whenever you detect user's activity.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文