Monday, November 10, 2008

Get Current Page Url using Asp.Net

There r many ways to take current page url. I have listed some ways here.

  • string path = System.IO.Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath);
  • string path1 = Request.FilePath.ToString();
  • string path2 = Request.UrlReferrer.AbsolutePath.ToString();
  • Uri UrlInfo = Request.Url; string path3 = UrlInfo.AbsolutePath;

No comments: