Solved

ASP .net refresh parent window

Posted on 2004-08-19
6
2,100 Views
Last Modified: 2008-01-09
Dear experts,

In the parent form, I have a html control:
<INPUT onclick="window.open('/frmSOP_SM_UAC.aspx','SMUAC','width=500, height=650, resizable=yes,toolbar=no,menubar=no,location=no')"
type="button" value="Add/ Revise Manager Data">

that opens another page in a separate window( the child window).
How to refresh the content of the parent window by clicking on a button on the child form?

Thanks for helping

etalexit.
0
Comment
Question by:etalexit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Assisted Solution

by:John-Doe
John-Doe earned 100 total points
ID: 11846410
Do opener.location.reload(); in a function or ie put this in the code of the opened window:

<input type="button" onClick="opener.location.reload();">

BR,
  -JD
0
 

Author Comment

by:etalexit
ID: 11846689
But this only applies to html control. How about web control?
0
 

Author Comment

by:etalexit
ID: 11851199
I put the code in the unload method for the page
<body onunload="opener.location.reload();">

When I close the browser, it dosen't seem to reload the parent window. ( I put a break point in the page_load method and it is not stepping in)
Any ideas?
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 9

Expert Comment

by:riyasjef
ID: 11851206
Hi

reload() fn display a "page refresh window" if there is a "form submit" in the parent window...

So it is better to use...


<input type="button" onClick="opener.location.href=opener.location.href;">

or

<input type="button" onClick="opener.location.replace(opener.location);">

0
 

Author Comment

by:etalexit
ID: 11851256
Ok, I got it, I should put it under the onbeforeunload event instead of onunload.
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20707549.html?query=javascript+onunload+not+&clearTAFilter=true
0
 
LVL 9

Accepted Solution

by:
riyasjef earned 400 total points
ID: 11851264

<asp:button runat="server" onServerClick="testFn" />


Then try this....

<script language="C#" runat="server">

     void testFn()
     {
           String str="opener.location.href=opener.location.href";
           RegisterClientScriptBolck("test",str);
     
     }
      
</script>




0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

730 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