亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

視圖不會在 MVC ASP.NET 呈現 CSS 和 Javascript

視圖不會在 MVC ASP.NET 呈現 CSS 和 Javascript

九州編程 2022-08-27 15:03:36
我從事一個 ASP.net MVC項目,我有一個包含共享布局中某些部分的視圖,我有三個共享布局視圖,其中一個包含CSS文件,第二個包含Java腳本文件,第三個包含HTML代碼,我用于將它們設置為視圖的一部分。@RenderPage我的觀點包含://html code@RenderPage("~/Views/Shared/_CssPage.cshtml")//html code@RenderPage("~/Views/Shared/_LeftSideBar.cshtml")//html code@RenderPage("~/Views/Shared/_JsPage.cshtml")_CssPage.cshtml :  <!-- Favicon--><link rel="icon" href="favicon.ico" type="image/x-icon"><!-- Google Fonts --><link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"><!-- Bootstrap Core Css --><link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet"><!-- Waves Effect Css --><link href="plugins/node-waves/waves.css" rel="stylesheet" /><!-- Animation Css --><link href="plugins/animate-css/animate.css" rel="stylesheet" /><!-- Morris Chart Css--><link href="plugins/morrisjs/morris.css" rel="stylesheet" /><!-- Custom Css --><link href="css/style.css" rel="stylesheet"><!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes --><link href="css/themes/all-themes.css" rel="stylesheet" />_LeftSideBar.cshtml :     <!-- Left Sidebar --><aside id="leftsidebar" class="sidebar">    <!-- User Info -->    <div class="user-info">        <div class="image">            <img src="images/user.png" width="48" height="48" alt="User" />        </div>
查看完整描述

1 回答

?
天涯盡頭無女友

TA貢獻1831條經驗 獲得超9個贊

我認為CSS和JS文件的路徑需要在鏈接之前添加。/

例:

原始路徑為

<link href="plugins/morrisjs/morris.css" rel="stylesheet" />

您需要在鏈接之前添加,如下所示:slash

<link href="/plugins/morrisjs/morris.css" rel="stylesheet" />

希望這對你有所幫助。


查看完整回答
反對 回復 2022-08-27
  • 1 回答
  • 0 關注
  • 92 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號