獲取本頁的相關信息可利用下面的兩個對象:
[csharp]
Uri uri =Request.UrlReferrer;
HttpContext http =HttpContext.Current;
/*例如:獲取當前頁的絕對路徑*/
string CurrentAbsoluteUrl =Request.Url.AbsolutePath.ToString();
string current = HttpContext.Current.Request.Url.PathAndQuery.ToString();
Uri uri =Request.UrlReferrer;
HttpContext http =HttpContext.Current;
/*例如:獲取當前頁的絕對路徑*/
string CurrentAbsoluteUrl =Request.Url.AbsolutePath.ToString();
string current = HttpContext.Current.Request.Url.PathAndQuery.ToString();
獲取上一頁的有關信息課利用下面的對象:
[csharp]
Uri urlreferrer=Request.UrlReferrer;
/*例如:獲取上一頁的絕對路徑*/
string pre = Request.UrlReferrer.AbsolutePath.ToString();
Uri urlreferrer=Request.UrlReferrer;
/*例如:獲取上一頁的絕對路徑*/
string pre = Request.UrlReferrer.AbsolutePath.ToString();