How to run one ASP page from Another ASP Page

H

Howard Rothenburg

Here is an example of running a different ASP page from a current web
page, using Javascript.

function window_onunload() {
var objSrvHTTP;
var objDoc;
var URL = "http://" + window.location.host + "/ASPPageToCall.asp;
objSrvHTTP = new ActiveXObject("MSXML2.XMLHttp");
objDoc = new ActiveXObject("MSXML2.DOMDocument");
objSrvHTTP.open ("POST", URL, true);
objSrvHTTP.send ();
objDoc = objSrvHTTP.responseXML;
alert(objDoc.xml);
}

---
ASP page called (ASPPageToCall.asp)
<%
Dim strSomeData
strSomeData = "Hello World"
Response.ContentType = "text/xml"
response.write "<ReturnValue>" & strSomeData & "</ReturnValue>"
%>

Please feel free to suggest any improvements to the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top