Pop-Up Window - Return data

Discussion in 'ASP .Net' started by Jeremy, Jun 27, 2004.

  1. Jeremy

    Jeremy Guest

    What would it take to create a pop-up window that displays some graphics
    (each with a bit of text). Ideally it would behave such that when a user
    clicks on a graphic, the pop-up window disappears and some data (e.g., some
    ID value of the graphich clicked) is then returned to the window from which
    the pop-up was opened?

    Thanks
    Jeremy, Jun 27, 2004
    #1
    1. Advertising

  2. Jeremy

    DalePres Guest

    You can use the window.createPopup() method of the web browser or the
    window.showModalDialog() or window.showModelessDialog() methods. I've done
    what you're asking about with each of them. Search MSDN for the methods and
    you'll be on your way.

    Dale

    "Jeremy" <> wrote in message
    news:%23uZTiE%...
    > What would it take to create a pop-up window that displays some graphics
    > (each with a bit of text). Ideally it would behave such that when a user
    > clicks on a graphic, the pop-up window disappears and some data (e.g.,

    some
    > ID value of the graphich clicked) is then returned to the window from

    which
    > the pop-up was opened?
    >
    > Thanks
    >
    >
    DalePres, Jun 27, 2004
    #2
    1. Advertising

  3. You're going to need to do most of this client side.
    Your 2 pages simply don't exist at the same points in time on the server, so
    they cannot communicate directly with eachother on the server.

    You can open a new window and pass it values using client side javascript
    such as this:
    a=window.open('MyPage.aspx?id=123','_new')
    There are all kinds of options for setting window properties such as window
    size and toolbar visibility.
    Here's more info:
    http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp

    From that new window you can reference the original parent window and pass
    values back to it with this javascript reference:

    Here's an example:
    window.opener.document.form1.mytextbox.value = 'whatever';

    Here's more info:
    http://www.mozilla.org/docs/dom/domref/dom_window_ref77.html

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com


    "Jeremy" <> wrote in message
    news:%23uZTiE%...
    > What would it take to create a pop-up window that displays some graphics
    > (each with a bit of text). Ideally it would behave such that when a user
    > clicks on a graphic, the pop-up window disappears and some data (e.g.,

    some
    > ID value of the graphich clicked) is then returned to the window from

    which
    > the pop-up was opened?
    >
    > Thanks
    >
    >
    Steve C. Orr [MVP, MCSD], Jun 27, 2004
    #3
  4. Jeremy

    Jeremy Guest

    Thank you (and DalePres) very much... just the sort of direction I need.

    -J


    "Steve C. Orr [MVP, MCSD]" <> wrote in message
    news:ulS$Wt$...
    > You're going to need to do most of this client side.
    > Your 2 pages simply don't exist at the same points in time on the server,

    so
    > they cannot communicate directly with eachother on the server.
    >
    > You can open a new window and pass it values using client side javascript
    > such as this:
    > a=window.open('MyPage.aspx?id=123','_new')
    > There are all kinds of options for setting window properties such as

    window
    > size and toolbar visibility.
    > Here's more info:
    >

    http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp
    >
    > From that new window you can reference the original parent window and pass
    > values back to it with this javascript reference:
    >
    > Here's an example:
    > window.opener.document.form1.mytextbox.value = 'whatever';
    >
    > Here's more info:
    > http://www.mozilla.org/docs/dom/domref/dom_window_ref77.html
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > http://Steve.Orr.net
    > Hire top-notch developers at http://www.able-consulting.com
    >
    >
    > "Jeremy" <> wrote in message
    > news:%23uZTiE%...
    > > What would it take to create a pop-up window that displays some graphics
    > > (each with a bit of text). Ideally it would behave such that when a user
    > > clicks on a graphic, the pop-up window disappears and some data (e.g.,

    > some
    > > ID value of the graphich clicked) is then returned to the window from

    > which
    > > the pop-up was opened?
    > >
    > > Thanks
    > >
    > >

    >
    >
    Jeremy, Jun 27, 2004
    #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. Shiperton Henethe
    Replies:
    17
    Views:
    5,390
    Deirdre Saoirse Moen
    May 21, 2004
  2. J P Singh
    Replies:
    3
    Views:
    301
    Howard Rothenburg
    Feb 11, 2004
  3. Madame Blablavatsky
    Replies:
    8
    Views:
    166
    Dr John Stockton
    Sep 16, 2005
  4. Richard Shewmaker

    Return focus to same pop-up window repeatedly

    Richard Shewmaker, Jan 19, 2006, in forum: Javascript
    Replies:
    13
    Views:
    160
    Pierre Sudarovich
    Mar 3, 2006
  5. ameyas
    Replies:
    4
    Views:
    146
    ameyas
    Mar 2, 2007
Loading...

Share This Page