ASP - Include External File

StephaneP used Ask the Experts™

I have a little problem...
I try to include an ASP file that is not on my Server.

I tried <!--#include file=""--> and Server.Execute but it's not working.

For example, if I want a webpage that have a specific design and in the middle of this page, I want to include the main page of Expert-Exchange, how can I proceed?

Another question linked to this one...

I know a Website that give informations about products, and I have the reference of this product, which appear on this Website as a ASP file with a table and informations in it. Is it possible to parse this file to recover all the information contained in it?

I want to use it to get data From another Website but not with the same layout and not all the informations contained in it. To I have to have an DB Access on the Website's database or is there another way to do it?

Thanks a lot,

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2013

If you incorporate someone else's page into your own page without permission, that is theft.  It is one thing to to load an external page in a frame without permisssion, but trying to steal content and include it in your own page is beyond any sort of acceptable ethical behaviour.  Do you not have any respect for the rights of of web site owners?

If you want someone's page ask for permission to downlaod it to your site.  



IF you have permission or display the full copyright of the user there are ways of doing this using HTTP calls to the various urls.


>>I try to include an ASP file that is not on my Server.

This is not possible unless you can map a network share as a drive on your server. If you can't do that, you can't use the file.

IOW, if it ain't yours, you can't use it. ;-)
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.


Thanks for the answers.
I don't want to use page I don't have permission to use! I respect intellectual property far more than copyright...;)

I'm a Web Developper, so I have a ethic sense about other work because I can understand as much as any other developper this feeling! ;)

The problem is that I don't want to download file, I want an automatic display incorporatedin my web page with a little layout change, or maybe a parsing of this file to retrieve the informations and handle it!


Then put it on your servers. If it's not on your server, you can't use it. For good reason -- if YOU could, so could anybody else who decided they liked/wanted it.
Hi Stephane,

I hope this helps and I am posting this comment for educational purposes only.. I am not encouraging "getting"
 other people's site without permission..

one way to do this is using the microsoft's xmlhttp object. the most basic function of this object is to return the entire text of another web page.

Let me know if this is what you want. Thanks.

  Response.Buffer = True
  Dim objXMLHTTP, xml

  ' instantiate the XMLHTTP OBJECT :
  Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
 'or you can use
  ' Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")

  ' open a connection to a remote website.
  objXML.Open "GET", "", False
  ' sends the request and returns the data:

  'Display the HTML both as HTML and as text
  Response.Write "<h1>HTML TEXT</h1><xmp>"
  Response.Write objXML.responseText
  Response.Write "</xmp><p><hr><p><h1>HTML PAGE</h1>"

  Response.Write objXML.responseText
  Set objXML = Nothing



Thanks for your answer, I thought of a solution like this!

Be assure that I will not use this method to "steal" other people work.

This is also very useful for other legitmate reasons.

Namely as a webmaster I have written several sites that I still maintain.  I am now using this to get external page counters for my own personal statistics to see which sites do well and which don't :)


Chris Farrell

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial