Refreshing parent window

  • Thread starter Thread starter Kenneth
  • Start date Start date
K

Kenneth

Hi,

I have two forms, parentForm and childForm. parentForm has
a button(btn1) and a grid. childForm has a couple of
textboxes and a button.

The button on parentForm opens a new window of childForm:

btn1.Attributes("onclick")="javascript window.open(...."

In childForm a couple of textboxes are filled in and then
saved with the button using normal sql behavior.

I need some function to refresh the parentForm from the
childForm to get the parentForm to update (show) what's
been added to the grid.

Something like:

window.opener.method

that will do the same thing as

Response.Redirect("parentForm.aspx")

thus showing the added record in the grid.

Any help is appreciated.

TIA

/Kenneth
 
window.opener.refresh() and window.opener.reload() should both work...

Hope this helps,

Mun
 
You need to write the following javascript code when you want to refresh the
parent window

window.opener.location.href = window.opener.location.href;
 
Saravana,
window.opener.location.href = window.opener.location.href;

is the one that works, but there's one thing that doesn't
work. When I save the first time, the result is not
showed, but when I save the next time the first saved
record is showed in the parentForm grid, and when saving
the third the second record is shown???

Any ideas?

Info for you: I use code behind in VB, and I have used a
normal javascript function between the <head> tags not a
Page.RegisterClientScriptBlock.

Upon calling the method in the javascript code I ise
webCtrl.Attributes("onlick")...

/Kenneth
 
I solved it myself, took some time, but I used the
Page.RegisterStartupScript with
window.opener.location.href and it just smashed in.

Thanks.

/Kenneth
 
Back
Top