RESOLVEURL / Url.Content等效于传统的ASP [英] ResolveUrl/Url.Content Equivalent in Classic Asp

查看:111
本文介绍了RESOLVEURL / Url.Content等效于传统的ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在表单/ MVC中,我们可以使用脚本和链接的,
脚本SRC =Url.Content(〜/脚本/ 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

这篇关于RESOLVEURL / Url.Content等效于传统的ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆