473,561 Members | 3,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1598
Public Function ProcessUrl(strU rlAddress)
ProcessUrl = ""
Set objXMLHTTP = CreateObject("M icrosoft.XMLHTT P")
objXMLHTTP.open "GET",strUrlAdd ress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.Resp onseText
Set objXMLHTTP = Nothing
End Function

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

"dlbjr" <oo**@iforgot.c om> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Public Function ProcessUrl(strU rlAddress)
ProcessUrl = ""
Set objXMLHTTP = CreateObject("M icrosoft.XMLHTT P")
objXMLHTTP.open "GET",strUrlAdd ress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.Resp onseText
Set objXMLHTTP = Nothing
End Function

Response.Write ProcessUrl("htt p://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.ServerX MLHTTP
vs. Microsoft.XMLHT TP), see http://www.aspfaq.com/2173

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:BZdnc.3939 96$Pk3.91251@pd 7tw1no...

"dlbjr" <oo**@iforgot.c om> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Public Function ProcessUrl(strU rlAddress)
ProcessUrl = ""
Set objXMLHTTP = CreateObject("M icrosoft.XMLHTT P")
objXMLHTTP.open "GET",strUrlAdd ress, false
objXMLHTTP.send
ProcessUrl = objXMLHTTP.Resp onseText
Set objXMLHTTP = Nothing
End Function

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

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

Jul 19 '05 #4
Server.Execute( "Myscript.a sp") 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**********@s haw.ca> wrote in message
news:xCbnc.3923 39$Pk3.376438@p d7tw1no...
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
9192
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
9675
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 call that in another page so that i get a random image the page is http://2006ymcanationals.com/index.php using <img
2
4738
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 child trying to call another cgi script and pass arguments to it. It works fine from the command line, and calls the required script and passes the...
8
8324
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 the folder to encrypted files. But when i call it thru asp program its not working fine. I have tried the following method.
8
4661
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 file and call it with the <script src="filename.js"></script> tags as I do for many other .js files. But, when I try to do that way, it doesn't...
8
5351
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> sections? I can't seem to figure out the syntax for for calling code-behind directly. The method is within the class my page inherits from and is...
4
1749
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 this: <asp:Button ID="Finish" runat="server" OnClick="sendEmail"> However, in this new web site version, when the button is pressed, to scripts are...
3
2066
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 php script is being called first it has access to the environment variables, but the Python script does nt. How can I forward the variables or...
47
3235
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 editor which is called on the Get_Content.php. in Main Page. I have included the js files in the head section. all the files are on the same...
4
3569
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 order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In...
0
8088
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7618
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5187
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3600
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2068
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1181
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.