Solved

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

Posted on 2007-11-20
3
708 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

919 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

15 Experts available now in Live!

Get 1:1 Help Now