SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Location
    Orange County, CA, Unites States
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Calling an ASP file from within an HTML page.

    My store software has both a header and footer file and each page of the store calls these files using:

    <!-- #include file="header.asp" -->
    <!-- #include file="WHATEVER PAGE CONTENT IT WANTS TO SHOW" -->
    <!-- #include file="footer.asp" -->

    Now, I run a different peice of software from a different developer and their software lets me inpute my HTML into a database. I enter something like this:

    HEADER HTML GOES HERE
    %CONTENT%
    FOOTER HTML GOES HERE

    What that does is allows me to hard code my HTML page into their software and call their content using the %CONTENT% text as shown above.

    Now, what I'd like to do is be able to include my store's header and footer file into the other developers software. Is there a way I can call the header and footer instead of pasting the complete HTML as I am doing right now?

    The reason I ask is there are frequent updates to the HTML header and footer of our store and it's a pain to continually update the other developers software with the new HTML changes. It would be nice to have the updates done automatically.

  2. #2
    SitePoint Evangelist comfixit's Avatar
    Join Date
    Dec 2004
    Location
    Pasadena
    Posts
    537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the file that you have control of is located on a server that supports server side includes then you could include an html file as follows:

    Code:
    <!--#include virtual="yourheader.html" -->
    To make it work you just need to save your primary file that contains the includes as an shtml file instead of html. For example: yourfile.shtml

    Hope this helps.

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are (as far I as I can see this early) 3 ways, 2 of which are kind of ugly and one which is a total hack:
    - put your header/footer inside (i)frames so the server can process the ASP.
    - use xmlhttp to grab the ASP generated HTML and insert it in your HTML page with javascript
    - change IIS to process all HTML files using the ASP interpreter, and <!-- #include --> the ASPs.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •