Simple function to get file name from active page
Author: Bruno Pinho
Rating:
Visits: 1142
Discuss in Newsgroups
Code:
<%
'***[begin : simple func to get file name from active page]***'
Function FileName()
Dim VarPath, ArrPath
'***[path for the active page/file]***'
VarPath = Request.ServerVariables("SCRIPT_NAME")
'***[splits path into array]***'
ArrPath = Split(VarPath, "/")
'***[file name with extension]***'
FileName = ArrPath(UBound(ArrPath,1))
'***[removes file ext (comment if the file ext is needed)]***'
FileName = replace(FileName,".asp","")
End Function
'***[finish: simple func to get file name from active page]***'
%>
Usage:
<%=FileName%>
Visit my guru profile
Visitor Comments