ResolveUrl / Url.Content Equivalent in Classic Asp

In webform / mvc we can use script and links like, script src = "Url.Content (" ~ / Scripts / util.js ")"

Can someone tell me what is equivalent in classic asp?

+6
source share
1 answer

There is no direct equivalent, there is not even a direct way to determine the virtual path of applications. The following VBScript functions should provide this function:

Function UrlContent(sUrl) If InStr(1, sUrl, "~/") = 1 Then UrlContent = ApplicationPath & Mid(sUrl, 2) Else UrlContent = sUrl End If End Function Function ApplicationPath() Dim pos: pos = Len(Request.ServerVariables("INSTANCE_META_PATH")) + 6 ApplicationPath = Mid(Request.ServerVariables("APPL_MD_PATH"), pos) End Function 
+7
source

Source: https://habr.com/ru/post/900486/


All Articles