Click to See Complete Forum and Search --> : how to block a pop up when the page is refrenced back


forampa
November 2nd, 2005, 08:23 AM
I have a page and though java script i call a web page which is a pop up page. If I call this page and close the page and then i click on some other link to go to the some other page and come back to the same page, the pop up page is again called somehow. How to block this pop up page once again?

rahulvasanth
November 7th, 2005, 07:13 AM
Is it possible for you to post that particualr bit of code ?

Rohit Kukreti
November 7th, 2005, 08:40 AM
If you have written the javascript in the pageload of the aspx page then it would be executed each time the page is loaded

m3rlinez
November 8th, 2005, 11:49 AM
I guess your problem was you need to display the popup only when user first enter the page. But, the popup appear everytime you enter that page.

I suggest you to divide your page into 2 frames: one with 100% height and one with 0% height, and put the popup code inside the 0% (hidden) frame. This is a simple solution.

Another approach is to save the state in the ASP.NET Session object. If the saved value == "showed" so you don't have to print popup code to the Response but if it is not "showed", set it to "showed" and print the popup code to the Response. So when user close their browser and reopen the page they will have different SessionID so the popup would appear again. But if they navigate the site back to the main page the popup wouldn't appear because the Session was set to "showed"

Hope that helps :D