Tuesday, January 11, 2011

How to get current page name in master page?

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

No comments:

Post a Comment