|
-
Jan 22nd, 2003, 04:20 PM
#1
Thread Starter
Lively Member
Is there a way to refresh one ASP.NET page from another?
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)?
-
Jan 22nd, 2003, 06:30 PM
#2
If the window was opened with an ID:
Page.Controls.Add(new LiteralControl("<script language=""javascript"">theotherwindowid.document.reload();</script>"))
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Jan 23rd, 2003, 09:42 AM
#3
Thread Starter
Lively Member
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.
-
Jan 23rd, 2003, 03:16 PM
#4
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.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Jan 23rd, 2003, 03:21 PM
#5
Thread Starter
Lively Member
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.
-
Jan 23rd, 2003, 06:35 PM
#6
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)
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Jan 24th, 2003, 11:41 AM
#7
Thread Starter
Lively Member
I tried this last bit of code and it works perfectly! Thanks for the help...much appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|