I want to write a c# method to retrieve the current page. eg Default6.aspx I know I can do the following:
string url = HttpContext.Current.Request.Url.AbsoluteUri;
// http://localhost:1302/TESTERS/Default6.aspx
string path = HttpContext.Current.Request.Url.AbsolutePath;
// /TESTERS/Default6.aspx
string host = HttpContext.Current.Request.Url.Host;
// localhost
but how can I get Default6.aspx? And if the url is http://localhost:1302/TESTERS/, my method should return default.aspx
Path.GetFileName( Request.Url.AbsolutePath )