Asp.Net Absolute Path of a URL

后端 未结 5 1170
天命终不由人
天命终不由人 2021-01-30 01:54

To make it simpler for a webapp to share files with another app on a different server, I\'m using a base href tag in my master page. As many people have discovered, this breaks

5条回答
  •  萌比男神i
    2021-01-30 02:19

    I have used following and it worked for me both client and the server.

    string surl = string.Format("{0}://{1}",
        HttpContext.Current.Request.Url.Scheme,
        HttpContext.Current.Request.Url.Authority);
    

提交回复
热议问题