Solved

How to handle ASP Session with Time Counter for dynamic site?

Posted on 2007-11-20
3
707 Views
Last Modified: 2012-06-21
We create a pop up with some message in JavaScript file. This will load after few seconds like 15sec. when page load. Since we place in a dynamic page, the popup loads every time when page loads e.g. /items.asp?Mc=HOZ , /items.asp?Mc=CH  or index.asp or any page... For avoiding multiple display of popup, we want to use session, i.e. for one session popup will display only once.
But the problem arises in using time counter...¦ We want to display that popup after 15 sec of loading time. When page loads & we waited for 15 sec it works fine... popup is displayed...
If we'™re not waiting 15 sec, and click on the other dynamic or asp links...¦ pop wasn'™t displayed in that time.

Can anybody have any solution or reference regarding this problem?

Thanks
0
Comment
Question by:psaini172000
3 Comments
 
LVL 5

Accepted Solution

by:
gocemi earned 500 total points
ID: 20318355
Hi,

Since problem exists when user navigates out of the page, timer stops and pop up is never shown ,
maybe you need to add another validation before leaving the page. I.e, add javascript body.onunload ='ceckPopUpShown';

What you need to do is to create var

var refToPopUp;

code to pop up window in here and instead of just window.open(urlto pop up),
Change that line to
refToPopUp = window.open(urlto pop up),

and on event body.onunload

function ceckPopUpShown()
{
if( refToPopUp == null )
//this means no window was open
{
//show window
window.open(urlto pop up)
}
}

body.onunload is event that is fired when body is unloaded and new page is to be shown in the browser
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21135885
Forced accept.

Computer101
EE Admin
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now