Jump to content

refreshing parent window


cyrus71

Recommended Posts

Hello I am working on my little forum,when sombody wants to answer a Topic, a popup window is opened and he can write his answer, when he is finnished he click on a button and the Topic goes to my DB, so far everything goes well, but i want that when he close the popup window the parent window which shows all topics be refreshed automaticly. but i have failed, it so easy and it is making me crazy.here it is a part of my popup file:<%@ Page Language="VB" Src="dbForum.vb" Inherits="dbForum" Debug="true" %><script runat="server"> Dim rubrik As String Dim brodtext As String Sub hamtaInlagg() Dim inId As Integer = Request.QueryString("inId") Dim myConnectionString As String = "Driver={MySQL ODBC;Option=3;" .... ..... End Sub</script><html><head> <!-- #include virtual="head.inc" --> <script type="text/javascript"> function refreshing() { var oParent = window.visainlagg.aspx; oParent.location.reload(); window.close(); } </script></head><body> <%If Request.QueryString("sent") = "yes" Then %> <enter><b> your Topic has been sent </b><br> <p><center><a href="refreshing()"><b>close window !</b></a></p> <%Else %>

Link to comment
Share on other sites

function load(file,target) { if(target != "") { target.window.location.href = file; } else { window.location.href = file; } } function wrapUp(url) { try { load(url,top.opener); window.close(); } catch(e) { alert(e.description); } }You may want to look into using hte Page_Load() function in your script then you can check for postback, on post back execute your function to update the users info and then use these lines after.Dim ScriptString As StringScriptString = "<script>wrapUp(ParentWindowURL);</script>"RegisterStartupScript("ScriptKey",ScriptString)Hope this helps

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...