Is there a way to refresh one ASP.NET page when a button on a second ASP.NET page is clicked (assuming both pages are part of the same application)?
Printable View
Is there a way to refresh one ASP.NET page when a button on a second ASP.NET page is clicked (assuming both pages are part of the same application)?
If the window was opened with an ID:
Page.Controls.Add(new LiteralControl("<script language=""javascript"">theotherwindowid.document.reload();</script>"))
The page that is to be reloaded was opened first (i.e. when the user navigated to the Website). How can I find out what the window ID is if I didn't set it? If I can do this, then I can store it in a session variable and use the code you posted below.
If you didn't set it, then it's out of scope.
Think of ir being private. If it's not part of your app, then by definition of being private, you cannot access it.
So, is there any other way to do it? The scenario is as follows:
I have an ASP.NET page with an IFRAME. The IFRAME contains the second ASP.NET page. I need to be able to click on an "update" button on the page within the IFRAME and have the browser refresh. If I use the META refresh, it will only refresh the page within the frame...not the main page in the browser.
In that case, the following should work (I've done exactly what you describe already):
Code:JavaScript = "<script language=""javascript"">" & vbCrLf
JavaScript += "parent.location.reload();" & vbCrLf
JavaScript += "</script>"
Response.Write(JavaScript)
I tried this last bit of code and it works perfectly! Thanks for the help...much appreciated!