This simple function returns the file name (i.e. default.aspx) of any page that it is called on.
VB.Net
C#Code:Public Shared Function GetCurrentPage() As String Return System.IO.Path.GetFileName(HttpContext.Current.Request.Url.AbsolutePath).ToLower End Function
Code:public static string GetCurrentPage() { return System.IO.Path.GetFileName(HttpContext.Current.Request.Url.AbsolutePath).ToLower; }



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks