Tuesday, July 11, 2006

Getting file name from URL...

What I wanted to achieve was, if the current page is
http://www.dubaidonkey.com/index.aspx I wanted to retrieve the name of the current page that is "index.aspx". And here goes the code for this. I dont know whether there is some easy method for this but this works fine for me...

Dim strURL() As String, strFileName As String
strURL = Request.Url.Segments
strFileName = strURL(strURL.Length - 1)

Hope someone will find it useful ;-)
Cheers
Rajesh Sivaraman.

No comments: