closing showModalDialog window from server side

  • Thread starter Thread starter jayuya
  • Start date Start date
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)
 
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
==============================
 
Back
Top