ASP 页面未检索导入文件

ASP page not retrieving import files

在基于现有站点的新创建的网站上,@import 未定位 CSS 文件。我只是试图为一个简单的 Hello World 提取 CSS 文件,以确保第一步正常运行。

HTML标题代码:

<head id="Head1" runat="server">
    <title>Company Name - Hello World</title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <style media="all" type="text/css">
        @import '<%# ResolveUrl("~/layout/HelloWorld.css")%>';
    </style>

</head>

使用 Chrome,开发人员工具显示以下内容:

<html>
<head id="Head1"><title>
    Company Name - Hello World
</title><meta http-equiv="X-UA-Compatible" content="IE=Edge" /><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <style media="all" type="text/css">
        @import '';
    </style>

</head>

站点的文件夹结构包含以下内容:


我已经对工作 ASP 站点和 Hello World 站点的 IIS 设置进行了并排比较,没有发现差异。我不知道为什么 @import 显示为空字符串。

非常感谢有关如何解决此问题的任何智慧。

应该是:

<link rel="stylesheet" type="text/css" href="~/layout/HelloWorld.css" />