Modal Windows Server side processing

Discussion in 'ASP .Net' started by Guest, Apr 6, 2004.

  1. Guest

    Guest Guest

    When I open a modal window using 'showModalDialog' from an aspx page it works fine. But when I then perform a submit in my modal window to get data from the server, instead of the page returning to the modal window with the new data the server creates a new, non-modal, window - leaving the modal window in the state it was and another, unrelated copy open with the requested data in it

    Can I get the data to return to the original modal window from the server without it opening a new (unwanted) window

    This is for a search that is intended to return data back to the original parent window after searching is complete.
     
    Guest, Apr 6, 2004
    #1
    1. Advertisements

  2. Guest

    matt Guest

    Not sure if this will work, but could you set the target of your form to
    be the original parent window this should result in the data being sent
    straight back to the original parent window.

    Matt

    it works fine. But when I then perform a submit in my modal window to
    get data from the server, instead of the page returning to the modal
    window with the new data the server creates a new, non-modal, window -
    leaving the modal window in the state it was and another, unrelated copy
    open with the requested data in it.
    server without it opening a new (unwanted) window?
    original parent window after searching is complete.
     
    matt, Apr 6, 2004
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    Thingis that I want to be able to perform various actions on the modal window that relate to a SQL database, and when I am finished then return to the parent.

    I can't make it return to the modal window after going to the server after user input - which is the problem I would really like to get around - and I can't work out any way to save user entered parameters without doing a server side trip and ending up on a newly created, non-modal, window.

    Trouble is - how do I go to another web page, provide user interaction including server side work, and return values to the parent page whilst not losing the parent's state and keeping the child page modal? The parent is not (typical) simple and includes multipage datagrids and numerous dropdownlists - so saving the state manually and reconstructing it is not trivial - hence the desire to go modal and return to an unchanged parent page

    But cannot figure out how. Modal - tick. Returning any number of values to the parent - tick. Going to the server from the modal page and returning to the modal page - nope. Very frustrated
     
    Guest, Apr 6, 2004
    #3
  4. Guest

    matt Guest

    Some other suggestions of things you could try.

    Use frames within your modal window. Submit the changes to one frame
    (could even be a 'hidden' frame with height of 0) within the modal
    window and ensure changes are reflected using JavaScript to "talk"
    between the frames.

    Use hidden form fields and JavaScript to save user entered parameters,
    which avoids having to make a server round trip, and then just make
    these changes when the final submission is made (which could then be
    back to the opening page).

    Matt


    window that relate to a SQL database, and when I am finished then return
    to the parent.
    after user input - which is the problem I would really like to get
    around - and I can't work out any way to save user entered parameters
    without doing a server side trip and ending up on a newly created,
    non-modal, window.
    including server side work, and return values to the parent page whilst
    not losing the parent's state and keeping the child page modal? The
    parent is not (typical) simple and includes multipage datagrids and
    numerous dropdownlists - so saving the state manually and reconstructing
    it is not trivial - hence the desire to go modal and return to an
    unchanged parent page.
    values to the parent - tick. Going to the server from the modal page and
    returning to the modal page - nope. Very frustrated
     
    matt, Apr 6, 2004
    #4
  5. Guest

    Guest Guest

    Frames raises interesting possibilities - I seem to remember reading somewhere about frames being used to 'trick' asp.net...but can't remember the details.

    I don't have a problem storing the data on the client side - just performing database accesses and then returning to the window I left, instead of ASP.Net opening a new window. (On postback it doesn't seem to 'remember' it came from a modal window - so it opens a new one.)

    Thanks for your help with this..
     
    Guest, Apr 6, 2004
    #5
  6. Guest

    matt Guest

    As far as I can tell you can't actual change the url of the modal window
    at all. It is not so much that on postback it doesn't remember it came
    from the modal window, but more that the post request is always
    submitted to a new window (this appears to be by design). The frame
    methodology allows you to not change the url of the modal window, and
    instead use the frames within the modal window.

    Hope that helps a bit more.

    Matt
    http://www.3internet.co.uk



    somewhere about frames being used to 'trick' asp.net...but can't
    remember the details.
    performing database accesses and then returning to the window I left,
    instead of ASP.Net opening a new window. (On postback it doesn't seem to
    'remember' it came from a modal window - so it opens a new one.)
     
    matt, Apr 6, 2004
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.