Solved

ASP .net refresh parent window

Posted on 2004-08-19
6
2,095 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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.

705 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

19 Experts available now in Live!

Get 1:1 Help Now