How can I get the baseurl of site?

后端 未结 12 1657
借酒劲吻你
借酒劲吻你 2020-11-30 17:43

I want to write a little helper method which returns the base URL of the site. This is what I came up with:

public static string GetSiteUrl()
{
    string ur         


        
12条回答
  •  悲哀的现实
    2020-11-30 17:45

    Please use the below code                           

    string.Format("{0}://{1}", Request.url.Scheme, Request.url.Host);
    

提交回复
热议问题