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?

4
  • 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. Commented Nov 1, 2011 at 7:55
  • But I need to use this in classic asp Commented Nov 1, 2011 at 7: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 : google.com/… Commented Nov 1, 2011 at 9:08
  • I also know how to use google. The reason for this post was that I have not found it there Commented Nov 1, 2011 at 9:24

1 Answer 1

6

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.