Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how to get full host name port number in application start of global aspx


how to get full host name port number in application start of global aspx  using -'c#,asp.net,url,request,hostname'

I tried

Uri uri = HttpContext.Current.Request.Url;
String host = uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port;


and it worked well on my local machine, but when being published to IIS7, there is an exception saying

System.Web.HttpException: Request is not available in this context


Anyone know how to achieve this?
    

asked Sep 13, 2015 by NikDowie
0 votes
12 views



Related Hot Questions



Government Jobs Opening


...