ASP creates HTML file, How can I get FrontPage to import it?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: ASP creates HTML file, How can I get FrontPage to import it?

Hybrid View

  1. #1
    Phil Guest

    ASP creates HTML file, How can I get FrontPage to import it?


    I have written a nice ASP page that uses forms to gather user input and then
    writes out a formated, static html page. That page uses FrontPage extensions
    (file include) for the header and footer. How do I tell FrontPage from the
    ASP file to import or check-in the file and process it. The only way I have
    been able to do that is by opening and closing the file using the frontpage
    client.

    Any hints out there? I have searched high and low.

    The essential code I use is:

    <%
    Dim fso, MyFile, MyFileTmp, FileRoot
    Sub CreateAfile(strMyFile)
    Dim strMyFileName
    strMyFileName = (strMyFile)
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyFile = fso.CreateTextFile(strMyFileName, True)
    End Sub

    strMyFile = (FileRoot & "default.htm")
    CreateAfile (strMyFileTmp)
    MyFile.WriteLine("<html><body>Hello<br></body></html>")
    MyFile.Close
    %>

  2. #2
    OScar Guest

    Re: ASP creates HTML file, How can I get FrontPage to import it?


    "Phil" <phil@yack.com> wrote:

    I think you must use #include on your ASP
    read this to see....


    Server-side include directives give you a way to insert the content of another
    file into a file before the Web server processes it. ASP implements only
    the #include directive of this mechanism. To insert a file into an .asp file,
    use the following syntax:

    <!-- #include virtual | file ="filename" -->
    The virtual and file keywords indicate the type of path you are using to
    include the file, and filename is the path and file name of the file you
    want to include.

    Included files do not require a special file name extension; however, it
    is considered good programming practice to give included files an .inc extension
    to distinguish them from other types of files.

    Using the Virtual Keyword
    Use the virtual keyword to indicate a path beginning with a virtual directory.
    For example, if a file named Footer.inc resides in a virtual directory named
    /Myapp, the following line would insert the contents of Footer.inc into the
    file containing the line:

    <!-- #include virtual ="/myapp/footer.inc" -->
    Using the File Keyword
    Use the file keyword to indicate a relative path. A relative path begins
    with the directory that contains the including file. For example, if you
    have a file in the directory Myapp, and the file Header1.inc is in Myapp\Headers,
    the following line would insert Header1.inc in your file:

    <!-- #include file ="headers\header1.inc" -->
    Note that the path to the included file, Headers\header1.inc, is relative
    to the including file; if the script containing this #include statement is
    not in the directory /Myapp, the statement would not work




  3. #3
    OScar Guest

    Re: ASP creates HTML file, How can I get FrontPage to import it?


    "Phil" <phil@yack.com> wrote:

    I think you must use #include on your ASP
    read this to see....


    Server-side include directives give you a way to insert the content of another
    file into a file before the Web server processes it. ASP implements only
    the #include directive of this mechanism. To insert a file into an .asp file,
    use the following syntax:

    <!-- #include virtual | file ="filename" -->
    The virtual and file keywords indicate the type of path you are using to
    include the file, and filename is the path and file name of the file you
    want to include.

    Included files do not require a special file name extension; however, it
    is considered good programming practice to give included files an .inc extension
    to distinguish them from other types of files.

    Using the Virtual Keyword
    Use the virtual keyword to indicate a path beginning with a virtual directory.
    For example, if a file named Footer.inc resides in a virtual directory named
    /Myapp, the following line would insert the contents of Footer.inc into the
    file containing the line:

    <!-- #include virtual ="/myapp/footer.inc" -->
    Using the File Keyword
    Use the file keyword to indicate a relative path. A relative path begins
    with the directory that contains the including file. For example, if you
    have a file in the directory Myapp, and the file Header1.inc is in Myapp\Headers,
    the following line would insert Header1.inc in your file:

    <!-- #include file ="headers\header1.inc" -->
    Note that the path to the included file, Headers\header1.inc, is relative
    to the including file; if the script containing this #include statement is
    not in the directory /Myapp, the statement would not work




  4. #4
    Phil Guest

    Re: ASP creates HTML file, How can I get FrontPage to import it?


    OScar,

    Thank you for your suggestion. I believe the
    issue is that the 'include' statement is only
    processed when FrontPage 'saves' or 'imports'
    the file into the FPweb. When I create the
    file directly on the server using ASP VBscript
    and close the file - it is written, but FP does
    not process it making the 'include' statement
    inert. My question is, "how do I tell FP to
    process, recalculate, the new file through using VBscript
    on the server? I would like to automatically
    accomplish this task. Manually, I can either
    open/close the file in FP or tell FP to recalculate
    the site.

    Thanks,

    /Phil



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center