Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP.NET/HTML/IIS Question

ASP.NET/HTML/IIS Question

Scheduled Pinned Locked Moved ASP.NET
helpcsharphtmlasp-netsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RX Maverick
    wrote on last edited by
    #1

    I have an odd issue and I'm hoping there is a way to do what I want. I'd like to have any HTML (.html and .htm) files go through a templating process first. So if a user tries to go to http://test/test.htm the server gives them the file that's been processed and had a template applied (default.master). I want this to only work on one of the sites in IIS not all of them. I was trying to work with the 404 error redirects but since the file is there that won't work. Basically when the server sees a .htm or .html I want it to redirect to TEST.aspx with the old path and name as part of the URL querrystring. The TEST.aspx will read the old file and remove everything before and after the body tags. Then put the remainder in between the Content tags of the aspx file which will let ASP.NET 2.0 process it and add the master page. I think I explained this well, if not please ask questions. Thanks

    P 1 Reply Last reply
    0
    • R RX Maverick

      I have an odd issue and I'm hoping there is a way to do what I want. I'd like to have any HTML (.html and .htm) files go through a templating process first. So if a user tries to go to http://test/test.htm the server gives them the file that's been processed and had a template applied (default.master). I want this to only work on one of the sites in IIS not all of them. I was trying to work with the 404 error redirects but since the file is there that won't work. Basically when the server sees a .htm or .html I want it to redirect to TEST.aspx with the old path and name as part of the URL querrystring. The TEST.aspx will read the old file and remove everything before and after the body tags. Then put the remainder in between the Content tags of the aspx file which will let ASP.NET 2.0 process it and add the master page. I think I explained this well, if not please ask questions. Thanks

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      You should look at writing a HttpHandler[^] that handles requests for HTML files within your website.

      Paul Marfleet

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups