473,320 Members | 1,884 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,320 software developers and data experts.

Calling an asp script from an asp script

My webpage assembles data from a database for display as an html webpage. I
would to have the ability for my clients to have custom scripts to control
the display. I would like the behaviour of just including the script e.g.:

<!--#include file="MyScript.asp" -->

but the problem is I don't know what the name of the script is until "run
time". Can I somehow call a function from an asp file that is in another asp
page and return a value to the calling page? The value would just be the
display string for the data.

So my main asp page would get the name of the asp page containing the
function as an argument and somehow execute and response.write the returned
string. Is this possible?
Jul 19 '05 #1
4 1584
Public Function ProcessUrl(strUrlAddress)
ProcessUrl = ""
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "GET",strUrlAddress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing
End Function

Response.Write ProcessUrl("http://www.server.com/whatever.asp")
Jul 19 '05 #2

"dlbjr" <oo**@iforgot.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Public Function ProcessUrl(strUrlAddress)
ProcessUrl = ""
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "GET",strUrlAddress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing
End Function

Response.Write ProcessUrl("http://www.server.com/whatever.asp")

Wow! Fantastic, thanks! I thought I was trying to do the impossible.
Jul 19 '05 #3
For more information, including the preferred progid (MSXML2.ServerXMLHTTP
vs. Microsoft.XMLHTTP), see http://www.aspfaq.com/2173

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:BZdnc.393996$Pk3.91251@pd7tw1no...

"dlbjr" <oo**@iforgot.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Public Function ProcessUrl(strUrlAddress)
ProcessUrl = ""
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "GET",strUrlAddress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing
End Function

Response.Write ProcessUrl("http://www.server.com/whatever.asp")

Wow! Fantastic, thanks! I thought I was trying to do the impossible.

Jul 19 '05 #4
Server.Execute("Myscript.asp") on iis 5.0 will work. The bonus is that all
the user information (Cookies, HTTP Headers,etc...) will be visible to the
second script. Using the XMLHttp will cause the Server to act as the
client, and any client side info will not be visible to the second script.

Lance
"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:xCbnc.392339$Pk3.376438@pd7tw1no...
My webpage assembles data from a database for display as an html webpage. I
would to have the ability for my clients to have custom scripts to control
the display. I would like the behaviour of just including the script e.g.:

<!--#include file="MyScript.asp" -->

but the problem is I don't know what the name of the script is until "run
time". Can I somehow call a function from an asp file that is in another asp
page and return a value to the calling page? The value would just be the
display string for the data.

So my main asp page would get the name of the asp page containing the
function as an argument and somehow execute and response.write the returned
string. Is this possible?

Jul 19 '05 #5

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

Similar topics

5
by: deko | last post by:
In regard to running php scripts with cron - Here is a sample script: <?php //debug.php echo "<br> This is a test"; ?> I can call debug.php from a web page on my site like this:
12
by: bhennon | last post by:
Hey all, I have a small php script that calls a random image at the following page. http://www.2006ymcanationals.com/random.php IT WORKS IF I go directly to the above link. I am trying to...
2
by: Shailan | last post by:
Hi Im having trouble with the following code that seems to be behave differently when called from the browser as opposed to the command line. The calling script is a cgi that forks, with the...
8
by: Vinod | last post by:
Hi, I have a problem, i am calling an exe from asp program. Its not working fine. When i execute the exe through the dos program directly i get the desired result. My exe will convert files in...
8
by: Jakej | last post by:
I've been using a javascript in an html file for a banner slider, and it works as desired. But I'd like to use it on more than one page and it would be great if I could transfer the code to a .js...
8
by: Brett Robichaud | last post by:
I understand how code-behind can handle events for a page, but can I call a code-behind method from within a <script> tag in my ASP.Net page, or can I only call methods defined in other <script>...
4
by: Miguel Dias Moura | last post by:
Hi, I just uploaded a web site and i am getting an error. I have a script which sends form values to an email using AspNetEmail. The script was working when i was calling the script like...
3
by: Anthony Smith | last post by:
In my php page I am calling a Python cgi. The problem is that originally the Python script was being called directly and it could access the environment variables that were being set. Now since the...
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...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.