how to maintain reference to all pop ups

Discussion in 'ASP .Net' started by sama via DotNetMonster.com, Sep 11, 2006.

  1. ------------------------------------------------------------------------------
    --

    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
    sama via DotNetMonster.com, Sep 11, 2006
    #1
    1. Advertising

  2. 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


    "sama via DotNetMonster.com" <u26474@uwe> wrote in message
    news:6621985479da8@uwe...
    > ------------------------------------------------------------------------------
    > --
    >
    > 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. Justin Gengo, Sep 11, 2006
    #2
    1. Advertising

  3. 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
    sama via DotNetMonster.com, Sep 11, 2006
    #3
  4. Sama,

    Ok, I understand what you want now. Give this a try:

    http://theopensourcery.com/jswin.htm

    Regards,

    --
    S. Justin Gengo
    Web Developer / Programmer

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

    "Out of chaos comes order."
    Nietzsche


    "sama via DotNetMonster.com" <u26474@uwe> wrote in message
    news:6621e9154988c@uwe...
    > 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
    >
    S. Justin Gengo, Sep 11, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass
    Replies:
    0
    Views:
    445
    Daniel Bass
    Jul 25, 2003
  2. Joel Barsotti

    validation with alert pop ups

    Joel Barsotti, Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    Steve C. Orr, MCSD
    Aug 8, 2003
  3. keiran

    Modal pop-ups in ASP.

    keiran, Jan 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    344
    =?ISO-8859-1?Q?Anders_Nor=E5s?=
    Jan 28, 2005
  4. Kieran Breen

    pop ups

    Kieran Breen, Feb 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    485
    Kieran Breen
    Feb 7, 2005
  5. Kieran Breen

    ASP.net pop.ups

    Kieran Breen, Feb 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    507
    Juan T. Llibre
    Feb 7, 2005
Loading...

Share This Page