Refreshing parent window

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
 
M

Munsifali Rashid

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

Hope this helps,

Mun
 
S

Saravana [MVP]

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

window.opener.location.href = window.opener.location.href;
 
K

Kenneth

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
 
K

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top