在 webform/mvc 中,我们可以使用脚本和链接,script src=" Url.Content("~/Scripts/util.js")"
In webform/mvc we can use script and links as, script src=" Url.Content("~/Scripts/util.js")"
谁能告诉我经典asp中的等价物是什么?
Can anyone tell me what is the equivalent in classic asp?
没有直接的等价物,甚至没有直接的方法来确定应用程序的虚拟路径.以下几个 VBScript 函数应提供该功能:
There is no direct equivalent, there isn't even a direct way to determine the applications virtual path. The following couple of VBScript functions should provide the feature:
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
这篇关于经典 Asp 中的 ResolveUrl/Url.Content 等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!