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. How to find the application URL

How to find the application URL

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netwindows-admintutorial
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.
  • A Offline
    A Offline
    Arjan Einbu
    wrote on last edited by
    #1

    How can I find the URL of the IIS application from a ASP.NET page. Is there a method or property I can use? Say I have an URL like this: "http://myserver/somedir/myappdir/somedir/somepage.aspx" In IIS myappdir is set up as the application, and I want to have code in somepage.aspx to return only "http://myserver/somedir/myappdir"

    P 1 Reply Last reply
    0
    • A Arjan Einbu

      How can I find the URL of the IIS application from a ASP.NET page. Is there a method or property I can use? Say I have an URL like this: "http://myserver/somedir/myappdir/somedir/somepage.aspx" In IIS myappdir is set up as the application, and I want to have code in somepage.aspx to return only "http://myserver/somedir/myappdir"

      P Offline
      P Offline
      Philip Patrick
      wrote on last edited by
      #2

      Well, if you are in some .NET control, it would be easy - just call ResolveUrl("~/") method (yes, with that "~/") Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer

      A 1 Reply Last reply
      0
      • P Philip Patrick

        Well, if you are in some .NET control, it would be easy - just call ResolveUrl("~/") method (yes, with that "~/") Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer

        A Offline
        A Offline
        Arjan Einbu
        wrote on last edited by
        #3

        Hmmm... Trying this from a webpage. (Not from a control)... Not working... Thanks though! :)

        P 1 Reply Last reply
        0
        • A Arjan Einbu

          Hmmm... Trying this from a webpage. (Not from a control)... Not working... Thanks though! :)

          P Offline
          P Offline
          Philip Patrick
          wrote on last edited by
          #4

          Yeah, this function only for control. Anyway, try this: Request.ApplicationPath Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer

          A 1 Reply Last reply
          0
          • P Philip Patrick

            Yeah, this function only for control. Anyway, try this: Request.ApplicationPath Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer

            A Offline
            A Offline
            Arjan Einbu
            wrote on last edited by
            #5

            Great! Thanks! I must've been blind not to see that one...:suss:

            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