Tuesday, November 1, 2022

How to find URL of current website DOMAIN NAME ASP.NET C#

 string Homepage = HttpContext.Current.Request.Url.ToString();

or

string Homepage = WebConfigurationManager.AppSettings["Homepage"].ToString();


web.config


<appSettings>

<add key="Homepage" value="http://pms.icar.gov.in/"/>

</appSettings>


Pleasew see also this:-

reference:- https://kapooryash.blogspot.com/2022/12/how-to-get-host-address-url-localhost.html





No comments:

Post a Comment