开发者

ASP.NET web app w/parent/child windows-parent times out, doesn't recognize use in child window

I've got a Jquery function that I wrote which blacks out the screen after a certain amount of inactivity, create开发者_JAVA技巧s 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜