Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear Friends,

Here iam Redirecting to Another page when iam redirecting.i want the Previous page name.

Ex:Anil.aspx when iam redirecting to this.aspx i should get the name of anil.aspx.


Regards,

Anilkumar.
Posted

C#
public string GetPreviousPageName()   
{   
 if (Request.UrlReferrer != null) 
 {
   string PName = Request.UrlReferrer.Segments[Request.UrlReferrer.Segments.Length - 1];    
   return PName;
 }
}
 
Share this answer
 
Comments
Espen Harlinn 17-Aug-11 18:16pm    
Right, my 5
Anil Honey 206 27-Oct-11 1:42am    
Its Good
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900