gpt4 book ai didi

asp.net - 经典 Asp 中的 ResolveUrl/Url.Content 等效项

转载 作者:行者123 更新时间:2023-12-02 18:51:39 24 4
gpt4 key购买 nike

在 webform/mvc 中,我们可以使用脚本和链接,脚本 src="Url.Content("~/Scripts/util.js")"

谁能告诉我经典asp中的等价物是什么?

最佳答案

没有直接的等价物,甚至没有直接的方法来确定应用程序虚拟路径。以下几个 VBScript 函数应提供该功能:

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.net - 经典 Asp 中的 ResolveUrl/Url.Content 等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7963635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com