By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,400 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,400 IT Pros & Developers. It's quick & easy.

Page1 refresh when Page2 close

P: 1
Hi, can anyone help me with this.

I have 2 pages, Page 1 is the main page while Page 2 is a flash page. When i close Page 2, I would like page 1 to be refreshed/re-retrieve from database because i need the data in the main page to be updated as data in the database will be changed when i am going through the flash pages.

Page2 is opened when a link in Page1 is clicked

i am using visual studio 2008 VB language

Thanks
Nov 25 '09 #1
Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
When you refer to "Page" do you mean Browser Windows?
Is "Page1" the parent browser window to "Page2" (the child browser window)?

You cannot do this using ASP.NET code (by this I mean your VB.NET code). Your VB.NET code runs on the server and it has absolutely no control over what happens with the browser.

You are going to have to use JavaScript for this purpose.

What you need to do (if you're talking about browser windows) is implement a JavaScript method in "Page1" (the parent window) that will postback to the server so that the page can be refreshed.

In "Page2" (the child window) you will have to implement a method that executes when the browser window closes. The only way (that I know of) to check when the window is being closed this is to use the JavaScript onbeforeunload event (this event is not supported by Opera at this time).

So when the onbeforeunload event happens in the child browser, you have to call the JavaScript method that posts back to the server in the parent window. You can use the window.opener to accomplish this.

I've moved your question to the JavaScript forum.

-Frinny
Nov 25 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.