![](/img/trans.png)
[英]Retrieving Specific information from multiple xml files and output to a html page
[英]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" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.