How to Properly Reference a JavaScript File in an ASP.NET Project?

前端 未结 4 978
醉梦人生
醉梦人生 2021-01-02 22:27

I have some pages that reference javascript files.

The application exists locally in a Virtual Directory, i.e. http://localhost/MyVirtualDirectory/MyPage.aspx

<
4条回答
  •  孤独总比滥情好
    2021-01-02 22:35

    Use ResolveUrl("~/")

    
    

    ~/ will get to you the root of your application, virtual or otherwise

提交回复
热议问题