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. Can't include file in aspx-page

Can't include file in aspx-page

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomsysadminwindows-admin
4 Posts 3 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.
  • E Offline
    E Offline
    EnkelIk
    wrote on last edited by
    #1

    Hi all. I have a web site on an IIS written in ASP.net (C#). I want to keep the top, the left side menu and the bottom of the page in separate files, and then just include the pages into my aspx-pages, so that the menu only needs to be changed once. I have tried and it works if I'm refering to a page in the same virtual directory, but I just can't find a way to include files into my aspx-pages, when the files are placed at another server than the aspx-page. I tried using a component from http://www.apnsoft.com/?LM=Include\_Main&MD=Include\_IncludePageFromURL and it works but apart from the fact that it now takes like 2 years to load the aspx-page (ok that may have other reasons though I don't know which), there is no "encoding" property on their webcontrol so the swedish letters å ä and ö doesn't come out right. Does anyone have any suggestions? I'm getting a bit desperate as the website is to be launched next week... Thanks /EnkelIk

    J R 2 Replies Last reply
    0
    • E EnkelIk

      Hi all. I have a web site on an IIS written in ASP.net (C#). I want to keep the top, the left side menu and the bottom of the page in separate files, and then just include the pages into my aspx-pages, so that the menu only needs to be changed once. I have tried and it works if I'm refering to a page in the same virtual directory, but I just can't find a way to include files into my aspx-pages, when the files are placed at another server than the aspx-page. I tried using a component from http://www.apnsoft.com/?LM=Include\_Main&MD=Include\_IncludePageFromURL and it works but apart from the fact that it now takes like 2 years to load the aspx-page (ok that may have other reasons though I don't know which), there is no "encoding" property on their webcontrol so the swedish letters å ä and ö doesn't come out right. Does anyone have any suggestions? I'm getting a bit desperate as the website is to be launched next week... Thanks /EnkelIk

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      IMHO, you'd be best served by looking into Web User Controls on MSDN. They are the ASP.NET equivilent to the old ASP-style include file. I'd recommend that you create a user control for the menu and one for the page bottom. You can then just add them onto the page as you would any other control. Unless you're attempting to interoperate with an existing ASP page, I can't see any reason that you would want to use an include file for your task. Hope that helps a bit. :) --Jesse

      E 1 Reply Last reply
      0
      • J Jesse Squire

        IMHO, you'd be best served by looking into Web User Controls on MSDN. They are the ASP.NET equivilent to the old ASP-style include file. I'd recommend that you create a user control for the menu and one for the page bottom. You can then just add them onto the page as you would any other control. Unless you're attempting to interoperate with an existing ASP page, I can't see any reason that you would want to use an include file for your task. Hope that helps a bit. :) --Jesse

        E Offline
        E Offline
        EnkelIk
        wrote on last edited by
        #3

        Thank you so much. A custom web control turned out to be a pretty nice solution ;) Thanks /EnkelIk

        1 Reply Last reply
        0
        • E EnkelIk

          Hi all. I have a web site on an IIS written in ASP.net (C#). I want to keep the top, the left side menu and the bottom of the page in separate files, and then just include the pages into my aspx-pages, so that the menu only needs to be changed once. I have tried and it works if I'm refering to a page in the same virtual directory, but I just can't find a way to include files into my aspx-pages, when the files are placed at another server than the aspx-page. I tried using a component from http://www.apnsoft.com/?LM=Include\_Main&MD=Include\_IncludePageFromURL and it works but apart from the fact that it now takes like 2 years to load the aspx-page (ok that may have other reasons though I don't know which), there is no "encoding" property on their webcontrol so the swedish letters å ä and ö doesn't come out right. Does anyone have any suggestions? I'm getting a bit desperate as the website is to be launched next week... Thanks /EnkelIk

          R Offline
          R Offline
          Rocky Moore
          wrote on last edited by
          #4

          You might also take a look at: http://www.codeproject.com/aspnet/RJContentPanel.asp[^] Can make it easier to create a templated site. I use this in most of my sites, giving me one main template page. Rocky <>< www.HintsAndTips.com www.MyQuickPoll.com - 2004 Election poll is #33 www.GotTheAnswerToSpam.com "We plan for the future, we learn from the past, we live life in the present!"

          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