get AppFriendlyName of currently executing web page in global.asa?
-
01-10-2020 - |
Question
I need to get access to the AppFriendlyName of a IIS application in the global.asa Application_Start event (classic ASP)
I am looking for the equivalent of HttpContext.Current.Request.ApplicationPath in the global.asax (ASP.NET)
Is there a way to do that ?
Thanks for your help !
Jerome Wagner
Solution
This is one way to do it..
path = Request.ServerVariables("URL")
position = InStr(2,path,"/",1)
Response.Write Right(Left(path,position-1),position-2) & "<br/>"
although it might not look good on the eyes ;)
UPDATE: Which of course doesn't work in Global.asa, since you can only use the Request object in Session_OnStart and Session_OnEnd. My bad, sorry.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow