我遇到了這個網站的問題,它好像是css和圖像文件(全部位於../ Content/文件夾中,這很奇怪,因爲我從來沒有見過這個錯誤在其他服務器上測試了我的網站。ASP.Net網站 - 不正確加載css文件
問題是我沒有直接訪問該服務器有問題,只能從這裏猜測可能是錯誤的。
網站由本地IIS託管並由http://localhost/application-name/site-name調用
css文件在mas中引用ter文件,並且圖像被引用,例如, 〜/內容/圖片/ sample.png
的Site Master
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%: Page.Title %> - Stackoverfl0w</title>
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<asp:ContentPlaceHolder ID="Stylesheets" runat="server">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.min.css">
<link rel="stylesheet" href="/Content/Site.css" type="text/css" />
</asp:ContentPlaceHolder>
<webopt:bundlereference runat="server" path="~/Content/css" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
</head>