If the application URL is something like www.myDomain.com/home/homepage.aspx , to get the http://www.mydomain.com/ part from it , we can use the following
(1)HttpContext.Current.Request.Url.Scheme+"://"+ HttpContext.Current.Request.Url.DnsSafeHost
or
(2)HttpContext.Current.Request.Url.Scheme+"://"+ HttpContext.Current.Request.Url.Host
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment