host name of site

Discussion in 'ASP .Net' started by John A Grandy, Jun 21, 2006.

  1. ASP.NET 2.0 IIS 5.5.

    In code-behind , how to determine the host name of the site ?
     
    John A Grandy, Jun 21, 2006
    #1
    1. Advertising

  2. Hi Jhn,

    Try this?

    Response.Write(Request.ServerVariables("Server_Name"))


    Ken
    Microsoft MVP [ASP.NET]

    "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
    news:...
    > ASP.NET 2.0 IIS 5.5.
    >
    > In code-behind , how to determine the host name of the site ?
    >
     
    Ken Cox [Microsoft MVP], Jun 21, 2006
    #2
    1. Advertising

  3. Request.ServerVariables("HTTP_HOST")


    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ===================================
    "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
    news:...
    > ASP.NET 2.0 IIS 5.5.


    > In code-behind , how to determine the host name of the site ?
     
    Juan T. Llibre, Jun 21, 2006
    #3
  4. Is this the same thing ?

    Request.Url.Host


    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:%...
    > Hi Jhn,
    >
    > Try this?
    >
    > Response.Write(Request.ServerVariables("Server_Name"))
    >
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    >
    > "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
    > news:...
    >> ASP.NET 2.0 IIS 5.5.
    >>
    >> In code-behind , how to determine the host name of the site ?
    >>

    >
    >
     
    John A Grandy, Jun 22, 2006
    #4
  5. Hi John,

    Yes, they're the same thing for the name of the server.

    Ken
    Microsoft MVP [ASP.NET]

    "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
    news:...
    > Is this the same thing ?
    >
    > Request.Url.Host
    >
    >
    > "Ken Cox [Microsoft MVP]" <> wrote in
    > message news:%...
    >> Hi Jhn,
    >>
    >> Try this?
    >>
    >> Response.Write(Request.ServerVariables("Server_Name"))
    >>
    >>
    >> Ken
    >> Microsoft MVP [ASP.NET]
    >>
    >> "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
    >> news:...
    >>> ASP.NET 2.0 IIS 5.5.
    >>>
    >>> In code-behind , how to determine the host name of the site ?
    >>>

    >>
    >>

    >
    >
     
    Ken Cox [Microsoft MVP], Jun 23, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joey
    Replies:
    0
    Views:
    358
  2. Orpheus66
    Replies:
    0
    Views:
    4,483
    Orpheus66
    Jul 30, 2003
  3. Anil G
    Replies:
    4
    Views:
    23,062
    v_parthi
    Jan 31, 2008
  4. Replies:
    0
    Views:
    460
  5. Jerry Qu
    Replies:
    1
    Views:
    508
    lee atkinson
    Feb 20, 2009
Loading...

Share This Page