Get Current Page Name In Asp.net, C# codebehind
Below method will give current page name in C#, asp.net Code behind:
/// <summary>
/// Pankaj lalwani
/// GetCurrentPageName
/// </summary>
/// <returns>Current Page name</returns>
public static string GetCurrentPageName()
{
string sPath = HttpContext.Current.Request.Url.AbsolutePath;
string[] strarry = sPath.Split(‘/’);
int lengh = strarry.Length;
string sRet = strarry[lengh - 1];
return sRet;
}
Comments (0)
Trackbacks (0)
Leave a comment
Trackback
Recent Comments