closing showModalDialog window from server side

J

jayuya

I have a simple page that I will like to display while i
am processing the user request in the server. The page
only has a label saying "Please Wait..."

My objective is to show this window while the code
executes in the server but I can not close it after i am
done... below is a sample code....

thanks in advance...
jayuya

js = "<script language=javascript>window.showModalDialog
('StatusDisplay.aspx','','dialogWidth=475px;dialogHeight=1
25px;status:no;help:no');</script>"

'displays window
RegisterStartupScript("StatusStartPage", js)
'run code
While minCounter <= maxCounter
////code to update records .....
/////code
minCounter = minCounter + 1 'looping to next power
End While

js = "<script language=javascript>window.close
();</script>"

'closes window
RegisterStartupScript("StatusEndPage", js)
 
V

Vidar Petursson

Hi

Seems you are trying to close the dialog from the parent.. thats not
possible...
You have to close the Dialog from the dialog window and another thing the
parent
is blocked while this dialog is running

maybe a regular window ( window.open ) is a better choice

If using window.open you can poll the parent ( using
setTimeout/setInterval) for some variable/flag and close if present
and use <body onblur="window.focus()" .... to keep it on top

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top