c# - 在 Visual Studio 中运行 asp.net mvc Web 应用程序时无法在 Web 浏览器中加载 CSS 和 Javascript 属性
问题描述
在运行使用 Visual Studio 2019 开发的 asp.net mvc Web 应用程序时,我无法加载 CSS 属性。我使用了布局页面 (_Layout1.cshtml) 并创建了一个视图“索引”,它继承了布局页面。在布局页面中,我使用了 html 页脚和页眉。
我尝试使用“@Url.Content”属性指定我创建的 myContent 文件夹下存在的 css 和 js 文件的路径。我没有收到任何错误,我只能看到浏览器中的文本,但没有加载 css。请找到屏幕截图以便更好地理解。
我只获得内容,但没有在浏览器中获得 CSS 和 js 属性:图片在这里
这是我在 cshtml 文件中 head 标签下的 html 代码的一部分:
<head>
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<title>Destino</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Destino project">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href=@Url.Content("/myContent/styles/bootstrap4/bootstrap.min.css")>
</head>
解决方案
推荐阅读
- r - 在ggplot2中的每个方面注释组均值
- angular - Angular 7 Bootstrap 指令不加载
- java - 如何在Java中创建一个将继续运行算法直到成功的算法
- ruby-on-rails - 如何使用进行 API 调用的 Gem 测试 Rails 应用程序
- html - 使用 PowerShell 检索视频库中的项目
- javascript - 在 Vue.js 中单击按钮时清除文本字段?
- java - IMap.delete 和 IMap.evict 之间的区别
- c# - 使用依赖注入过滤属性
- db2 - 在 OSX 上使用 db2cli
- julia - 保留内部类型定义:在另一个结构中定义结构数组