Ask a Question
Advertise on boostr.in
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'
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?
Sep 13, 2015
to add a comment.
Related Hot Questions
Government Jobs Opening