Jun 11
7
Getting The Current File Name in Vb.Net
Leave a comment »
Some times you need to figure out what the actual file name is a the web page that you are on. If this is the case, here is the easy way to do this in the code behind:
Dim myPage As String = System.IO.Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath)
If you are on a page, myPage will have just the page name in it (i.e. for the default page the value would be default.aspx).