ASP .net refresh parent window

Dear experts,

In the parent form, I have a html control:
<INPUT onclick="'/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

Who is Participating?
riyasjefConnect With a Mentor Commented:

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

Then try this....

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

     void testFn()
           String str="opener.location.href=opener.location.href";

John-DoeConnect With a Mentor Commented:
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();">

etalexitAuthor Commented:
But this only applies to html control. How about web control?
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

etalexitAuthor Commented:
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?

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;">


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

etalexitAuthor Commented:
Ok, I got it, I should put it under the onbeforeunload event instead of onunload.
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.