C# .NET - reload the parent window - Asked By sachin ohri on 07-May-06 11:43 PM

Hi,
   I am opening a pop up(aspx page) window using window.open() in javascript. i have a save btn(server control) on my pop up and i want that when i click on this btn i am able to reload the parent window without closing my pop up.

With javascript - Asked By Virgil Hretcanu on 08-May-06 12:32 AM

Hi Sachin,
Well, you can use javascript for that:
[CODE]
opener.window.reload();
[/CODE]
this will reload the parent window. add this script the same way you added the one that opens the popup.
--Virgil

reload the parent window - Asked By sachin ohri on 08-May-06 01:40 AM

Hi,
  i wrote  window.open on a click of button on parent window. and the btn for saving in pop-up is a asp.net control so where and how should i write opener.window.reload();
i also have a user control on my parent page which i also need to call reload event of

code inside - Asked By Virgil Hretcanu on 08-May-06 02:10 AM

So, here is the Click event of your Save button of your popup:
[CODE]
protected void saveButton_Click(object sender, EventArgs e)
    {
        string javascript = @"<script language=javascript>
                        window.opener.location.reload()
                      </script>";
        Response.Write(javascript );
    }
[/CODE]

Now, if you want the browser not to prompt you to reload the data from the server you can relace the javascript function with this:
[CODE]
window.opener.location = window.opener.location
[/CODE]

Both work fine,
--virgil
Asked By Shallu Gupta on 08-May-06 04:55 AM
Use
Window.Opener.Refresh()