Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2009-12-20
9
Medium Priority
?
812 Views
Last Modified: 2012-05-08
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
0
Comment
Question by:sbornstein2
  • 4
  • 4
9 Comments
 
LVL 9

Expert Comment

by:AsishRaj
ID: 26092635
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
 
LVL 9

Expert Comment

by:AsishRaj
ID: 26092654
Let me know  if something doesnt work
0
 

Author Comment

by:sbornstein2
ID: 26092810
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sbornstein2
ID: 26092814
your code is doing the reload in the same call, I need to call the reload from another page.
0
 
LVL 9

Expert Comment

by:AsishRaj
ID: 26092974
  • 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
 

Author Comment

by:sbornstein2
ID: 26093053
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
 
LVL 9

Expert Comment

by:AsishRaj
ID: 26093067
Can you post the code. how are you calling the processing page and processing page code.
0
 

Author Comment

by:sbornstein2
ID: 26093596
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
 
LVL 15

Accepted Solution

by:
fsze88 earned 2000 total points
ID: 26095383
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

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question