ASP.NET MVC URL auto-resolution in CSS files

前端 未结 6 1638
遇见更好的自我
遇见更好的自我 2021-02-02 09:43

In normal WebForms scenario, any root-relative URLs (e.g. ~/folder/file.txt) inside CSS files such as:

.form { background-image: url(~/Content/I         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-02 10:13

    You could use an URL Rewriter to fix the URL as the request comes in, though I am not so sure it is so much elegant as a hack in this case.

提交回复
热议问题