This will work only when one redirects using Hyperlink or Response.Redirect.
C#
protected void Page_Load(object sender, EventArgs e)
{
if (Request.UrlReferrer != null)
{
string previousPageUrl = Request.UrlReferrer.AbsoluteUri;
string previousPageName = System.IO.Path.GetFileName(Request.UrlReferrer.AbsolutePath);
}
}
VB.Net
Protected Sub Page_Load(sender As Object, e As EventArgs)
If Request.UrlReferrer IsNot Nothing Then
Dim previousPageUrl As String = Request.UrlReferrer.AbsoluteUri
Dim previousPageName As String = System.IO.Path.GetFileName(Request.UrlReferrer.AbsolutePath)
End If
End Sub