6

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

Can anyone tell me what is the equivalent in classic asp?

Imran Qadir Baksh - Baloch
  • 32,612
  • 68
  • 179
  • 322
  • 1
    not an answer to the question but ASP.NET has method called `ResolveUrl` for `System.Web.UI.Control` class. It is better to do your research based on this. It will pop up more results. – tugberk Nov 01 '11 at 07:55
  • But I need to use this in classic asp – Imran Qadir Baksh - Baloch Nov 01 '11 at 07:58
  • 2
    Yes, I figured that. That's why I pointed out that my comment is not an answer to your question. here is a google search for you : http://www.google.com/#sclient=psy-ab&hl=en&source=hp&q=resolveurl+in+classic+asp&pbx=1&oq=resolverurl+on+clasi&aq=1jl&aqi=g-l1g-jl1g-lm1&aql=1&gs_sm=e&gs_upl=83l9080l0l10675l24l20l3l0l0l0l407l4260l0.9.9.1.1l23l0&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&fp=f10181c958c90d45&biw=1280&bih=612 – tugberk Nov 01 '11 at 09:08
  • I also know how to use google. The reason for this post was that I have not found it there – Imran Qadir Baksh - Baloch Nov 01 '11 at 09:24

1 Answers1

7

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
AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306