更新时间:2023-02-11 21:53:52
您仍然可以获取 HttpContext 然后使用 HttpContext.Current.Request.Url
You can still get the HttpContext and then use HttpContext.Current.Request.Url
SPContext.Current.Web 是围绕您所在页面的 SPWeb,因此其 URL 是 Web 的 URL,而不是页面.
SPContext.Current.Web is the SPWeb surrounding the page you're on, and thus its URL is the URL of the Web, not the page.