Reference app relative virtual paths in .css file

后端 未结 8 2095
生来不讨喜
生来不讨喜 2020-12-24 02:03

Assume I have an \"images\" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app

8条回答
  •  长情又很酷
    2020-12-24 02:53

    Put your dynamic CSS in a user control in an .ascx file and then you do not need to run all your css files through the asp.net page processer.

    <%@ Control %>
    
    

    But the easiest way to solve the ~ problem is to not use a ~ at all. In Visual Studio, in Solution Explorer, right click your application, select Properties Window and change the Virtual Path to /.

提交回复
热议问题