Get current page name in ASP.NET

Tuesday, 21 February 2012

Get current page name in ASP.NET


The below code is for get current page name in application:


string sPath = System.Web.HttpContext.Current.Request.Url.AbsolutePath;

System.IO.FileInfo oInfo = new System.IO.FileInfo(sPath);

Response.Write(oInfo.Name);

No comments:

Post a comment