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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Site structure problem

Site structure problem

Scheduled Pinned Locked Moved ASP.NET
csharphelpjavascriptasp-netcom
5 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.
  • G Offline
    G Offline
    gvanto
    wrote on last edited by
    #1

    I was wondering what the typical site structure is that people use for asp.net sites? I am using C# asp.net 2.0 and have a default.aspx page which points to a master page, MasterPage.master (which contains references to images, javascript, etc). I would like to organise sub-areas like: mysite.com/subdir/Default.aspx So I created this above page, and reference the MasterPage.master, but when I navigate to this page (during run mode) the images and javascript are messed up since they're all being referenced from the directory above (in which the masterpage resides). Is there an elegant way of getting around this problem? I was thinking of creating a 'sub-level' master page but this won't be ideal since then any changes to the masterpage will require double the efforts (which kind of goes against what a master page is about anyway!) Do most asp.net sites ONLY use the root directory? Any help much appreciated! Gerry asp.net newbie

    Make $ With Domains http://www.dntutor.com

    P 1 Reply Last reply
    0
    • G gvanto

      I was wondering what the typical site structure is that people use for asp.net sites? I am using C# asp.net 2.0 and have a default.aspx page which points to a master page, MasterPage.master (which contains references to images, javascript, etc). I would like to organise sub-areas like: mysite.com/subdir/Default.aspx So I created this above page, and reference the MasterPage.master, but when I navigate to this page (during run mode) the images and javascript are messed up since they're all being referenced from the directory above (in which the masterpage resides). Is there an elegant way of getting around this problem? I was thinking of creating a 'sub-level' master page but this won't be ideal since then any changes to the masterpage will require double the efforts (which kind of goes against what a master page is about anyway!) Do most asp.net sites ONLY use the root directory? Any help much appreciated! Gerry asp.net newbie

      Make $ With Domains http://www.dntutor.com

      P Offline
      P Offline
      Psycho Coder Extreme
      wrote on last edited by
      #2

      One thing I learned when using Master Pages and wanted the Master in its own directory (which I think is a good idea) is with all the images, style sheets, .js files and such to add this around them:

      <%=ResolveClientUrl("~/YourDirectory/YourStyleSheet.css") %>
      <%=ResolveClientUrl("~/YourDirectory/YourImageName.jpg") %>
      <%=ResolveClientUrl("~/YourDirectory/YourScriptName.js") %>

      Then (of course) replace my place holders with your information (example, your header is located in images/main_images then the tag around the header image would be

      <%=ResolveClientUrl("~/images/header.jpg") %>

      Hope this at least gets yous tarted.

      "Let's face it, the average computer user has the brain of a Spider Monkey." Bill Gates

      G 1 Reply Last reply
      0
      • P Psycho Coder Extreme

        One thing I learned when using Master Pages and wanted the Master in its own directory (which I think is a good idea) is with all the images, style sheets, .js files and such to add this around them:

        <%=ResolveClientUrl("~/YourDirectory/YourStyleSheet.css") %>
        <%=ResolveClientUrl("~/YourDirectory/YourImageName.jpg") %>
        <%=ResolveClientUrl("~/YourDirectory/YourScriptName.js") %>

        Then (of course) replace my place holders with your information (example, your header is located in images/main_images then the tag around the header image would be

        <%=ResolveClientUrl("~/images/header.jpg") %>

        Hope this at least gets yous tarted.

        "Let's face it, the average computer user has the brain of a Spider Monkey." Bill Gates

        G Offline
        G Offline
        gvanto
        wrote on last edited by
        #3

        Thanks very much Psycho Coder, this seems to fix it just dandily fine! :-) :-D

        Learn How to Make $ With Domains http://www.dntutor.com

        P 1 Reply Last reply
        0
        • G gvanto

          Thanks very much Psycho Coder, this seems to fix it just dandily fine! :-) :-D

          Learn How to Make $ With Domains http://www.dntutor.com

          P Offline
          P Offline
          Psycho Coder Extreme
          wrote on last edited by
          #4

          Not a problem, thats what this community is for :) PS: When someone gives you the solution that works you should give them a 5 vote on their answer

          "Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean." Tom Welch

          G 1 Reply Last reply
          0
          • P Psycho Coder Extreme

            Not a problem, thats what this community is for :) PS: When someone gives you the solution that works you should give them a 5 vote on their answer

            "Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean." Tom Welch

            G Offline
            G Offline
            gvanto
            wrote on last edited by
            #5

            Done. What a wicked community?! I just posted a new post (at the top) :-) G

            Learn How to Make $ With Domains http://www.dntutor.com

            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