SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Sep 2007
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Includes ?

    I know that there are php includes that allow you to insert an item into a webpage so that the code is hidden in a different page. (ie menu.php, header.php, etc).

    Does ASP have something similar?

    Thanks,

    sarb

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For JSP you'd do:


    <%@include file="path/to/file.jsp" %>

    For ASP you'd do:

    <!--#include file="file.inc"-->

  3. #3
    SitePoint Addict
    Join Date
    Sep 2007
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do I need to give the web page the include is on an .asp extension vs an .htm extension. And does the page with the menu on it that is the actual include also need to have an .asp extension or can it be an .htm?

    I see in your example that the file is called file.inc.

    Thanks,
    Sarb

  4. #4
    SitePoint Addict
    Join Date
    Sep 2007
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    asp includes? Is there such a thing?

    Hi,

    I recently created a web page that incorporates a PHP include, so that instead of putting the menu on each and every page and having to update the links on each and every page, I was able to link the menu via a PHP include so I only have to change the new link once and it would automatically change on all the site pages.

    Unfortunately, I found out the client doesn't have PHP on their server. But they do have ASP on their server and can access ASP pages.

    I'm wondering if and how you could do this using ASP instead of PHP???

    Thanks,
    Sarb

  5. #5
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The nearest equivalent is Server Side Includes.

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

    <!--#include virtual="/the_file_to_be_included.asp" -->

    http://www.codefixer.com/tutorials/include_files.asp
    Ian Anderson
    www.siteguru.co.uk

  6. #6
    SitePoint Addict
    Join Date
    Sep 2007
    Posts
    203
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that is perfect. Thank you for the tutorial and your help.

    Sarb

  7. #7
    SitePoint Wizard silver trophy rushiku's Avatar
    Join Date
    Dec 2003
    Location
    A van down by the river
    Posts
    2,056
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    .inc is used to indicate that the file is included, or even that it is a incomplete code fragment, however, the file extension has no bearing on whether or not a file may be included.

    That said, you may include any file with any extension, or even no extension.


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
  •