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 get the Site Address from a page

How to get the Site Address from a page

Scheduled Pinned Locked Moved ASP.NET
comtutorialquestion
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.
  • T Offline
    T Offline
    TheMajorRager
    wrote on last edited by
    #1

    Hello Everyone, I am working on this project, and I was wondering if there is a way to get the site address from a page. Lets say we are at www.codeproject.com, is there a way to get codeproject from URL so we know what site address we are at? Sincerely, The Major Rager

    I B 2 Replies Last reply
    0
    • T TheMajorRager

      Hello Everyone, I am working on this project, and I was wondering if there is a way to get the site address from a page. Lets say we are at www.codeproject.com, is there a way to get codeproject from URL so we know what site address we are at? Sincerely, The Major Rager

      I Offline
      I Offline
      iamrashida83
      wrote on last edited by
      #2

      use: Request.Url.Host

      Regards, Rashida Jabeen http://www.akaas.net[^]

      T 1 Reply Last reply
      0
      • T TheMajorRager

        Hello Everyone, I am working on this project, and I was wondering if there is a way to get the site address from a page. Lets say we are at www.codeproject.com, is there a way to get codeproject from URL so we know what site address we are at? Sincerely, The Major Rager

        B Offline
        B Offline
        Britney S Morales
        wrote on last edited by
        #3

        Try this code line. Request.PhysicalApplicationPath, it return the physical address, but its something.. ;P

        keep Learning and you never will be out of date...

        1 Reply Last reply
        0
        • I iamrashida83

          use: Request.Url.Host

          Regards, Rashida Jabeen http://www.akaas.net[^]

          T Offline
          T Offline
          TheMajorRager
          wrote on last edited by
          #4

          Thanks it works!

          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