While server-side include directives can’t be processed dynamically; that is, using ASP variables for filenames, you can perform the same action by opening the file and dumping it out to the browser. Here’s a few lines of code that will do this for you:
Sub IncludeFile(strFilename)
Dim objFSO, objFile, strContents
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(Server.MapPath(strFilename), 1, False)
strContents = objFile.ReadAll
Response.Write strContents
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
End Sub
Give this function a virtual pathname (like /includes/file.asp) and it will open the file and dump it out where you need it. You can manipulate the filename as much as you need with this method.