Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    asp code in .html file?

    Is there any way to configure IIS to allow asp code in a file with a .html extension?

    Thx,
    Ash

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    i believe you can do that.
    Open your site/virtual dir in IIS, click the configuration button (on the virtual dir tab or the home dir tab) click add, point to the asp.dll, enter the html extension, save and you should be ready.
    Better to restart the server service to make sure changes take effect.

    Good luck with it.
    Roelf
    I am the luckiest man in the world

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ok, IIS is configured for .html to parse asp code however...

    template.html refuses to parse asp code, even though IIS has been configured to parse asp code in files with the .html extension. I have tested it with another html file and it parses fine (in every directory). Perhaps you can determine, by the snippet of code below, why template.html will not - and hopefully provide a solution?

    Code:
    set fs = CreateObject("Scripting.FileSystemObject")
    
    IF NOT fs.FileExists(Server.MapPath("templates\template.html")) THEN
    response.write("<p>An error has occured.</p><p>The &quot;template.html&quot; file does not exist.  Please make sure that your HTML template is in the &quot;templates&quot; folder and the file name is &quot;template.html&quot;")
    ELSE
    
    set file = fs.OpenTextFile(Server.MapPath("templates\template.html"),1,0)
    
    HTML_string = file.ReadAll
    
    set file = nothing

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Are you sure the code is enclosed in <% and %> ? Or you configured a different directory?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    try simple asp code, with no chance of makin typos, like

    <%
    Response.Write "Boo"
    %>
    I am the luckiest man in the world


  •  

    Posting Permissions

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