ShowModalDialog - IE - how do I location back to it to reload page?

I have an aspx page in .net application and I am totally stuck because my popup won't stay on top and the showmodaldialog on a location.href etc, nothing works, reload etc.  I need to have on a processing page from the modal dialog close the processing page and refresh the modal dialog box again.  The regular window.open and then location.href works but the popup wont stay on top.  Ugghhh
sbornstein2Asked:
Who is Participating?
 
fsze88Commented:
sbornstein2,
example code should something help you.
parent page is your process page
any problem or enhance please let me know
parent page
<script type="text/javascript">
var i=0;
 
function openModal(){
var returnVal = window.showModalDialog('showModalDialog.html',this);
alert("returnVal : " + returnVal);
}
 
</script>
<a href="javascript:;" onclick="openModal();">openModal()</a>
 
<form name="form1">
<input type="text" name="text1" style="display:none" onclick="alert('abc');">
</form>
 
 
Modal Dialog page
 
 
<html>
<head>
<title>Modal Dialog</title>
</head>
  <body >
    <a href="http://www.google.com"  onclick="window.returnValue = this.href;window.close();return false;">Click here</a>
    <a href="#" onclick="openerwindow.document.form1.text1.onclick();return false;">openerwindow.document.form1.text1.onclick()</a>
  </body>
  
  <script type="text/javascript">
  var openerwindow =window.dialogArguments; 
  
  </script>
</html>

Open in new window

0
 
AsishRajCommented:
Refer below code. works for me perfectly

function PopUpFunction()
{    
    var WinSettings = "center:yes;resizable:no;dialogwidth: 400px;dialogHeight:300px"
    var MyArgs = window.showModalDialog("PopUPpagetoOpen.aspx", '', WinSettings);
    window.location.reload();
}

<asp:LinkButton ID="Link_NewCity" runat="server" CssClass="NoteExample" OnClientClick="CreateNewCity()"  >New City</asp:LinkButton>

Open in new window

0
 
AsishRajCommented:
Let me know  if something doesnt work
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
sbornstein2Author Commented:
not sure exactly what you have here.  So here is what I have:

Main page calls the window.showdialog which pops up my dialog box right.

On the show dialog the user does some data entry and then the form submit action calls a processing page.  In that processing page I do some code to save data.  Now in that processing page right in the HTML of the aspx page I have javascript.  So how do I reload that modal popup from the processing page which was just called from the form submit action of the modal dialog.

Hope this makes sense.
0
 
sbornstein2Author Commented:
your code is doing the reload in the same call, I need to call the reload from another page.
0
 
AsishRajCommented:
  • You are calling processing page just to do the processing and then return back to this model popup. Did i get it correctly here.
  • So you have (1)main page -> (2)popup opens-> you submit -> (3)then another popup opens-> process data -> then closes itself and refresh (2)parent popup. Right
0
 
sbornstein2Author Commented:
thats correct Asish yes.  The only thing is (3) is just called from a submit from (2) the modal popup.  I have in the form tag action the page to post to.  So its (3) I am trying to load back (2)
0
 
AsishRajCommented:
Can you post the code. how are you calling the processing page and processing page code.
0
 
sbornstein2Author Commented:
i beleive you cant reload or refresh a modal dialog box from all that I am seeing right now.  You can test it anytime by launching a window.showmodeldialog and then from the modal popup call a simple form submit and then on the form submitting to that is the page I need to call the reload on the modal popup and close the submit form which would be the processing page.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.