Modal Windows Server side processing

G

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

matt

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

CaptainZ said:
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.
 
G

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
 
M

matt

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


CaptainZ said:
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
 
G

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

matt

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



CaptainZ said:
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.)
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top