how to maintain reference to all pop ups

  • Thread starter sama via DotNetMonster.com
  • Start date
S

sama via DotNetMonster.com

------------------------------------------------------------------------------
--

Hi ,
I have developed an application which consists of many pages.
On a page x, user can click a button to get some pop up.
Now when he navigates to other pages and comes back to this page again, on
click the button , i want to show the same pop up instead of creating a new
pop up.
So how do i store the reference for the pop up which should not be destroyed
when user navigates to different pages and comes back to same page.


Regards,
Sama

--
Sama
India

Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200609/1
 
S

S. Justin Gengo

Sama,

One way would be to just leave the popup open. As long as the javascript for
the popup is naming the window and as long as the same window name is always
used the javascript will re-use the window of that name each time the popup
is opened.

If you need to store what values are in the popup you can do that in a
number of different ways. If there isn't a lot of information to save you
could persist it in viewstate as you move from one page to another, although
that could get complicated. Another choice (probably better, again as long
as not a lot of information is being stored) would be to save to a session
variable. If a lot of information needs to be save then you could write it
to a file on the system and use a pointer saved in session to recover the
file (maybe xml) or you could save to a database.

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
S

sama via DotNetMonster.com

Hi justin,
first of all thanks a lot for your prompt reply.
I think I am not very clear in asking the question. I have a
different issue.
I have used a variable as:

<input id="Button1" type="button" value="button" onclick="displayUploadPopUp
()"/>


var opopup;
if(opopup && opopup.open && !opopup.closed) {
alert('already open so setting focus');
opopup.focus();
}
else {
alert('new window');
window.open('Child.aspx', 'ChildpopUp', 'width=468,height=211,scrollbars=no,
titlebar=0, menubar=no');
}

now when the parent page refreshes and i click the button "Button1" , else
part is executed even when the pop up is already there. The point is that the
variable opopup is lost when the parent page is refreshed.
So now the quetion is how do i remeber that the child pop up was already out
and instead of showing a new pop up, how do i focus the old one.

Hope i am clear.

--
Sama
India

Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200609/1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top