Asp.Net Absolute Path of a URL

后端 未结 5 1076
天命终不由人
天命终不由人 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条回答
  •  一向
    一向 (楼主)
    2021-01-30 02:20

    Using string interpolation:

    string redirectUri = $"{this.Request.Url.Scheme}://{this.Request.Url.Authority}{this.Request.ApplicationPath}account/signedout";
    

    Substitute 'this' for 'HttpContext' or 'HttpContext.Current' based on context.

提交回复
热议问题