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. General Programming
  3. .NET (Core and Framework)
  4. How to emebed a html file in another html file

How to emebed a html file in another html file

Scheduled Pinned Locked Moved .NET (Core and Framework)
htmltutorial
5 Posts 4 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.
  • U Offline
    U Offline
    User 3055467
    wrote on last edited by
    #1

    Hi, I have a website that's running from several months. Most of the web pages contain a common marquee tag. I want to put the tag in a html file and embed the html file wherever needed so that when ever a change is made to the marquee tag it affects all the web pages. Thanks in advance

    S N 2 Replies Last reply
    0
    • U User 3055467

      Hi, I have a website that's running from several months. Most of the web pages contain a common marquee tag. I want to put the tag in a html file and embed the html file wherever needed so that when ever a change is made to the marquee tag it affects all the web pages. Thanks in advance

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      The easiest way is probably with Server Side Includes[^] You put a tag like this in your main html page

      which points to the other html file that contains the html you want to insert. The server (either IIS or Apache) will insert this file when the page is served. This is something that I believe is turned on by default on IIS and Apache, but you may have to rename your main html to myfile.shtml to indicate that you want to process SSIs in the file. (This means that you may also have the change the default pages for your directories if you rely on default pages being default.html or something like that). Some of this may vary between providers though, so if in doubt check with your web host.

      Simon

      T 1 Reply Last reply
      0
      • U User 3055467

        Hi, I have a website that's running from several months. Most of the web pages contain a common marquee tag. I want to put the tag in a html file and embed the html file wherever needed so that when ever a change is made to the marquee tag it affects all the web pages. Thanks in advance

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        First, this would probably be better asked in the Web Development or ASP.NET forum since it has nothing to do with .NET Framework. Have you considered using an asp.net master page?


        I know the language. I've read a book. - _Madmatt

        1 Reply Last reply
        0
        • S Simon P Stevens

          The easiest way is probably with Server Side Includes[^] You put a tag like this in your main html page

          which points to the other html file that contains the html you want to insert. The server (either IIS or Apache) will insert this file when the page is served. This is something that I believe is turned on by default on IIS and Apache, but you may have to rename your main html to myfile.shtml to indicate that you want to process SSIs in the file. (This means that you may also have the change the default pages for your directories if you rely on default pages being default.html or something like that). Some of this may vary between providers though, so if in doubt check with your web host.

          Simon

          T Offline
          T Offline
          The Man from U N C L E
          wrote on last edited by
          #4

          Didn't even know you could turn off server side includes. You definitely do not need to rename the file though. However aspx pages may not process server side includes. Not much point considering what they do.

          If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) www.JacksonSoft.co.uk

          S 1 Reply Last reply
          0
          • T The Man from U N C L E

            Didn't even know you could turn off server side includes. You definitely do not need to rename the file though. However aspx pages may not process server side includes. Not much point considering what they do.

            If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) www.JacksonSoft.co.uk

            S Offline
            S Offline
            Simon P Stevens
            wrote on last edited by
            #5

            The Man from U.N.C.L.E. wrote:

            Didn't even know you could turn off server side includes. You definitely do not need to rename the file though.

            You can[^], and you can also configure them to only be executed for specific file extensions, so it does depend on what your web host has got setup. My web host only processes SSIs on files named .shtml and .shtm. By default I think it's just on for all files, but you can't rely on that when you didn't do the IIS install yourself.

            The Man from U.N.C.L.E. wrote:

            aspx pages may not process server side includes. Not much point considering what they do.

            Yup, SSIs are not processed on aspx pages. You could probably hack up an alternative using something like Response.Write(), but like you say, not much point for asp. You'd probably just use something like master pages instead.

            Simon

            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