473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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
Apr 5 '06 #1
6 7752
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"
Apr 5 '06 #2
I'm not sure how to retrieve that string but you could try Response.Redirect
"abcd" <ab**@abcd.com> wrote in message
news:%2****************@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

Apr 5 '06 #3
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

Apr 5 '06 #4
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:
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

Apr 5 '06 #5
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:
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"
Apr 5 '06 #6
abcd wrote:
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


i don't see anything wrong in the code. Is it timing out? If so, this means
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"
Apr 5 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Earl | last post by:
If calling an exe that accesses a database from an ASP page, does the Provider string to connect to the database from inside the exe need to have the user as being "IUSR..." or something since it...
0
by: Mike Collins | last post by:
I apologize for using this newsgroup for what seems like a VB6 question, but I did not see a newsgroup for VB6. I also think I may not have the C# code setup correctly for calling from VB6. If...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
2
by: Harold | last post by:
I have page A with form field and a button and when button is clicked it opens page B in another window. Page B has a treeview control and that is all. When something is selected I want the page...
1
by: desmcc | last post by:
Hi, I am launching a modal dialog through the usual javascript (window.showmodaldialog). When the modal dialog is complete (ie user selects OK), the calling page then refreshes itself by setting...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
0
by: jobs | last post by:
I have a page where users select from a bunch of gridviews, setting session variables and then hit an a New or Edit button which redirects them to a formview in edit or insert mode. While in...
47
by: mukeshrasm | last post by:
Hi I am calling two pages using Ajax Get_Pages.php and Get_Content.php from combo box. Both pages are displayed based on selection from combo box. Main problem is that it is not showing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.