Solved

ASP .net refresh parent window

Posted on 2004-08-19
6
2,096 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
  • 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Searchbox Branding 11 45
Did new SSL certificate DNS cause Robots.txt /Sitemap problems?  500 POINTS 2 101
Stupid git question 2 63
WIX Redirect 1 38
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now