Get current page name in Asp.net

This function can be used to retrieve the current page  name.

    public string GetCurrentPageName()
    {
        string Path = System.Web.HttpContext.Current.Request.Url.AbsolutePath;
        System.IO.FileInfo Info = new System.IO.FileInfo(Path);
        string pageName = Info.Name;
        return pageName;
    }

Next Recommended Reading Displaying Favicon in ASP.NET Page