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. I just want my root

I just want my root

Scheduled Pinned Locked Moved ASP.NET
javascriptcomsysadmintools
1 Posts 1 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.
  • S Offline
    S Offline
    Sam Heller
    wrote on last edited by
    #1

    Good day all who read. I'm having some problems with including some Javascript files. I have recently restructured my website so that all the pages site in seperate folders dependant on which section they are part of. I am using the ~ attribute all over the place to reference other pages and images etc. This all works fine. In my masterpage I want to include some Javascript external files but I can't use the ~ tag as this ruins the script tag. Therefore I am using the following in Page_Load Page.ClientScript.RegisterClientScriptInclude("MAD", Request.Url.ToString().Replace(Request.Path, String.Empty) + "/Javascript/MAD.js") Someone suggested this and as much as it does work locally it doesn't on the webserver. This is because the site lie in a sub directory. This code drops the subdirectory. Therefore I am looking for the code that can traverse and output the domain (www.thesite.com), any ports that may be used (thanks to local versions with virtual server), and any sub domains that the app may be running in ( /Testapp ). I have tried Server.Mappath but this doesn't seem to include the file correctly. Also I don't want a local path in the page's outputted code. Thanks

    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