|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
calling another page
How can I call one ASP page from another
Page1.asp returns me some strings in the form of response.write Page2.asp will call page1.asp and use that long string returned from page1.asp.... How can I do that thanks abcd wrote:
> How can I call one ASP page from another http://www.aspfaq.com/show.asp?id=2173> > Page1.asp returns me some strings in the form of response.write > > Page2.asp will call page1.asp and use that long string returned from > page1.asp.... > > How can I do that > > thanks -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" thanks BOB
does this call CreateObject("MSXML2.ServerXMLHTTP") requires any special components to be installed on the server thanks Bob Barrows [MVP] wrote: Show quote > abcd wrote: >> How can I call one ASP page from another >> >> Page1.asp returns me some strings in the form of response.write >> >> Page2.asp will call page1.asp and use that long string returned from >> page1.asp.... >> >> How can I do that >> >> thanks > http://www.aspfaq.com/show.asp?id=2173 The MSXML Parser is probably already there, but yes, the MSXML Parser needs
to be installed. Your only other option is to replace the response.writes in the other page with assignments to string variables and use an SSI instead. With a SSI, string variables in the included page are accessible to "host" page (page2.asp). Better yet, create functions in page1.asp that return the string values, individually, or in an array: page1.asp: <% 'instead of 'response.write "one" 'response.write "two" 'do this: function GetStrings() ar = array("one", "two") GetStrings=ar end function %> Page2.asp: <!-- #include virtual="page1.asp" --> <% ar=GetStrings response.write join(ar,"; ") %> Even better, use a class in the included page ... Bob Barrows abcd wrote: Show quote > thanks BOB > > does this call CreateObject("MSXML2.ServerXMLHTTP") > > requires any special components to be installed on the server > > thanks > > > > Bob Barrows [MVP] wrote: >> abcd wrote: >>> How can I call one ASP page from another >>> >>> Page1.asp returns me some strings in the form of response.write >>> >>> Page2.asp will call page1.asp and use that long string returned from >>> page1.asp.... >>> >>> How can I do that >>> >>> thanks >> http://www.aspfaq.com/show.asp?id=2173 -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" I have written the code as below
sURL = "http://localhost/test/test.asp" set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "GET", sURL, false xmlhttp.send "" y = xmlhttp.responseText set xmlhttp = nothing test.asp looks like as below <% Response.ContentType = "application/text" Response.Write("hello World") Response.End %> my variable y doesnt get the string "hello World" whats wrong in above code Bob Barrows [MVP] wrote: Show quote > abcd wrote: >> How can I call one ASP page from another >> >> Page1.asp returns me some strings in the form of response.write >> >> Page2.asp will call page1.asp and use that long string returned from >> page1.asp.... >> >> How can I do that >> >> thanks > http://www.aspfaq.com/show.asp?id=2173 abcd wrote:
Show quote > I have written the code as below i don't see anything wrong in the code. Is it timing out? If so, this means > > sURL = "http://localhost/test/test.asp" > set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") > xmlhttp.open "GET", sURL, false > xmlhttp.send "" > y = xmlhttp.responseText > set xmlhttp = nothing > > > test.asp looks like as below > > <% > Response.ContentType = "application/text" > Response.Write("hello World") > Response.End > %> > > > my variable y doesnt get the string "hello World" > > whats wrong in above code > you are sending a request to a file in the same virtual directory as the calling file. They need to be different web sites Bob Barrows -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" I'm not sure how to retrieve that string but you could try Response.Redirect
Show quote "abcd" <a***@abcd.com> wrote in message news:%23BT5SlNWGHA.1084@TK2MSFTNGP04.phx.gbl... > How can I call one ASP page from another > > Page1.asp returns me some strings in the form of response.write > > Page2.asp will call page1.asp and use that long string returned from > page1.asp.... > > How can I do that > > thanks > > |
|||||||||||||||||||||||