Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to update 2 different servers

Status
Not open for further replies.

sknyppy

Programmer
May 14, 1999
137
US
I have an add-event button that when clicked opens a new window with a few fields to fill out.

After hitting the submit button in the popup
I need to do the following:
1) Insert the information on the current server.
2) Insert the information on a remote server.
3) Refresh the parent window.
4) Close the child window.

This is the code I using now but it doesn't refresh the parent window.

--------------
<%
qIncident = &quot;INSERT INTO myTable(Fields) Values(Values)&quot;
adoDataConn.Execute(qIncident)

qSIncident = &quot;SELECT myField FROM myTable&quot;
SET EventID = adoDataConn.Execute(qIncident)

myString = &quot;
Response.Redirect(myString)
%>

<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
opener.location.reload();
window.close();
</SCRIPT>
--------------

Thanks,
Dave
 
Try this

Code:
window.opener.location.reload(true)


vlad
 
You problem is that you are performing the redirect before the javascript, and as the redirect inserts a 302 into the header of the document it never makes it to the body where it can execute your javascript.

A better idea is to write something like this:-

<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
opener.location.reload();
location.href='<%=myString%>'
</SCRIPT>

and then have the window.close() on the remoteserver/inetupdate site.

Alternatively, if you're running under w2k then instead of response.redirect, use server.execute, which will execute the required page and then return control to your asp.

If this does not work then use the xmlhttp object to POST to the remote page, and read back the response, before performing your javascript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top