这是我的asp代码
<link id="Link1" rel="stylesheet" runat="server" media="screen" href="~/Styles/css/tableStyle.css" />
<link id="Link2" rel="stylesheet" runat="server" media="screen" href="~/Styles/css/LoadingStyle.css" />
<link id="Link3" rel="stylesheet" runat="server" media="screen" href="~/Styles/css/selectStyle.css" />
页面打开但没有样式,我的意思是表格和选择没有我为它们制作的样式。
我试过
在 google chrome 上点击 f12 所以我得到了这些错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:31200/~/Styles/css/selectStyle.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:31200/~/Styles/css/LoadingStyle.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:31200/~/Styles/css/tableStyle.css
最佳答案
那是因为如果您浏览到 http://localhost:31200/~/Styles/css/selectStyle.css
没有这样的资源。
您可能想要 http://localhost:31200/Styles/css/selectStyle.css
.因此,删除 ~
您的 href
中的符号:
<link id="Link1" rel="stylesheet" runat="server" media="screen" href="/Styles/css/tableStyle.css" />
<link id="Link2" rel="stylesheet" runat="server" media="screen" href="/Styles/css/LoadingStyle.css" />
<link id="Link3" rel="stylesheet" runat="server" media="screen" href="/Styles/css/selectStyle.css" />
关于c# - ASP 无法加载资源 : the server responded with a status of 404 (Not Found) error in server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22560334/