Announcement

Collapse
No announcement yet.

#includes for asp code - how?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Michael McSharry
    replied
    Yes you can, that is the typical use of include files so common functions can be used in multiple applications

    Leave a comment:


  • alevey
    Guest replied
    If I have functions on the and ASP page and I want to separate them out, can I just cut/paste into a new page, place into includes dir, and make an include reference <!--#include virtual= "/includes/CtrlFunctions.asp"--> at the top of the pages?

    Leave a comment:


  • Jebus
    replied
    Thanks Michael
    That clears up some things I was thinkin bout.
    I believe now that INCLUDE FILE pertains to CFGUYS filecontents.asp, which is where I had started to use the "include file" statement. I now use that asp and statement exclusively for all asp's....JG

    Leave a comment:


  • Michael McSharry
    replied
    Jebus,
    In the IIS world, Virtual is relative to root of the server's virtual directory (e.g. /HTML or /wwwroot), while File is relative to the file that makes the include. I did not play around to see what homeseer's convention is. I have always used Virtual with it.

    Leave a comment:


  • Stevech
    replied
    Thanks a ba-zillion to Rupp and Paul - I now havea an ASP working as the root page and a lot of VBScript working too.

    This is on my project to have web pages sent to my TV set's aux-video in from the HomeSeer PC. Web pages contain specially formatted HomeSeer things, TV listings for each evening (reparse of GIST.COM), weather, etc. Scroll the pages and switch pages using the TV's remote and irMAN hardware.

    Leave a comment:


  • Jebus
    replied
    <!--#include virtual= "/somefile.asp"-->
    and
    <!--#include file= "/somefile.asp"-->

    I have used both and I'm not sure of the difference................................JG

    Leave a comment:


  • Hunter Green
    replied
    Mike, that's great... I've read several threads here trying to find the trick of making that work and agreeing that it wasn't possible. Cool.

    Nucleus Home Automation

    Leave a comment:


  • Rupp
    replied
    asp pages need, as the first line in the file
    <%@ Language=VBScript %> or
    <%@Language=javascript%> I believe. At east if your running your pages on IIS I'm pretty sure Rich is requiring it as well.

    -Rupp

    Leave a comment:


  • Stevech
    replied
    With HomeSeer's web server (latest beta), one gives a file name is in the HomeSeer options setting for the customize web page. Can this file be an asp file or must it (the root file) be HTML?

    I have a file which is all-HTML, no script, but if I give it an ASP extension, HomeSeer says error in line 1 statement expected. The file has no <% tag in it. That same file works fine if it has an HTM suffix. I presumed that the server would take the contents of an ASP which has no <% tags and just process it as is. (I named it as ASP as a starting point in testing - it would later contain script code).

    Sorry for the dumb newbie question.

    Leave a comment:


  • paugusto
    Guest replied
    The other thing that might not be that obvious from Michael's post is that the includes don't need the <% %> tags in them if they are between the tags in the asp. This allows you to share the same include between scripts and asp pages.

    I'm not sure if this is unique to the HS web server - that's the only one I run.


    Paul

    Leave a comment:


  • Michael McSharry
    replied
    Paul Augusto pointed this out to me and I now use it for all my new includes. As an example to include the script includes in my AudreyUtilitiesTest.asp I use...
    <%
    <!--#include virtual= "/../Scripts/Includes/AudreyUtilityExtensions.inc"-->
    <!--#include virtual= "/../Scripts/Includes/AudreyUtilities.inc"-->
    <!--#include virtual= "/../Scripts/Includes/IniTool.inc"-->
    %>

    Leave a comment:


  • Stevech
    replied
    thanks. I was trying to code for an asp file which was in a subdirectory of the homeseer html directory. I believe you are saying that this cannot now be done - the file must be in the html directory. I'll try that.

    Leave a comment:


  • Hunter Green
    replied
    <!--#include "filename.asp"-->

    Note that you can't include files that aren't in the HTML directory somewhere this way. For a "common header" this is probably no problem, but when you start wanting to include the functions you've written and put in your scripts/include directory, you're out of luck until/unless Rich "fixes" this.

    Nucleus Home Automation

    Leave a comment:


  • Stevech
    started a topic #includes for asp code - how?

    #includes for asp code - how?

    I am a newbie at this asp idea...

    I have several asp pages with VB script sprinkled in the pages. And I wish to have a heading appear on every web page. Same heading. That heading is a mix of HTML and ASP VB Script.

    I cannot figure out how to #include or whatever so that a file with the common code is referenced by each using page. I looked around; got mired down in Server Side Includes which apparently the HomeSeer web server doesn't support. Then I stumbled with the HTML comment tag for include a file. Stumped on that one.

    Thanks in advance for anyone who can show me how to #include an ASP file, invoked by an ASP file.

    steve
Working...
X