Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: how to refresh a javascript modal dialog


Message #1 by "P Meert" <paulgiverny@h...> on Fri, 1 Mar 2002 09:22:12
I open a modal dialog from an aspx page to open another aspx page as a 
popup (the second one is a selection-list that eventually will send it's 
selection back to the opener). The popup aspx is a table filled with 
results from a query. The user can then select a row in the table and the 
result is send back to the parent window (lobj_element holds a ref to a 
textbox on the openers window, that will contain the selection) 

[side-note: is there a better way to do this, I basically need a combobox 
and simulate it with a textbox and a modal dialog-box]

var lobj_element=document.all['txtName'];
window.showModalDialog("InfoList.aspx",lobj_element,"dialogHeight: 250px; 
dialogWidth: 150px; dialogTop: px; dialogLeft: px; edge: Raised; center: 
Yes; help: No; resizable: No; status: No;");

The first time everything works fine but when i open the popup later on 
again, i see the same results. A breakpoint in the (Infolist.aspx) 
Page_load reveals that this code is not executed again after the first 
time the popup is shown.

I tried window.location.reload() this does not do anything (put 2 alerts 
around it and those are shown)

Then i tried:

window.navigate('infolist.aspx');

When this is executed, a new browser window opens with the correct 
results, but of course that's not what i want either. 

Anyone know how to force the page_load to re-execute when the modal dialog 
is reopened (or how to effectively destroy all remains of the modal dialog 
after closing ?) Or is their just a plain better way of accomplishing the 
whole thing instead of using modal dialogs ?


  Return to Index