[英]ASP page not retrieving import files
On a newly created website, based on an existing site, the @import is not locating the CSS files. 在基于现有站点的新创建的网站上,@ import找不到CSS文件。 I am just attempting to pull in the CSS files for a simple Hello World in order to make sure that this first step is functioning.
我只是试图为简单的Hello World提取CSS文件,以确保第一步正常运行。
The HTML heading code: 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>
Using Chrome, the Developer Tools displays the following: 使用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>
The folder structure for the site contains the following: 该站点的文件夹结构包含以下内容:
I have done a side by side comparison of the IIS settings for a working ASP site and the Hello World site, and not differences have been found. 我对工作中的ASP站点和Hello World站点的IIS设置进行了并排比较,但未发现差异。 I am at a loss as to why the @import is displaying as an empty string.
我不知道为什么@import显示为空字符串。
Any wisdom as to how to resolve this is greatly appreciated. 任何有关如何解决此问题的智慧都将受到赞赏。
它应该是:
<link rel="stylesheet" type="text/css" href="~/layout/HelloWorld.css" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.