Practical approach of getting Current and previous Page name from the
URL
In this blog we are going to see how we parse the Current and previous page name from the URL.
1. Used Namespaces
using System.Web;
2. Getting Current Page name from the URL
internal static string
GetURLName()
{
Uri uri = HttpContext.Current.Request.Url;
return
uri.Segments[uri.Segments.Length - 1].ToLower();
}
3. Getting Previous page name from URL
internal static string
GetPreviousURLName()
{

Join the conversation! Your thoughts help the community grow.