ResolveUrl/Url.Content Equivalent in Classic Asp(经典 Asp 中的 ResolveUrl/Url.Content 等效项)
问题描述
在 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 等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:经典 Asp 中的 ResolveUrl/Url.Content 等效项


基础教程推荐
- c# Math.Sqrt 实现 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01