类中使用ResolveUrl
1>获取当前page然后调用ResolveUrl
System.Web.UI.Page page = HttpContext.Current.CurrentHandler as System.Web.UI.Page; String url=page.ResolveUrl("url");
2>VirtualPathUtility.ToAbsolute
System.Web.VirtualPathUtility.ToAbsolute("~/path")
时间: 2024-09-28 17:28:33