0
I’m making an application in MVC Asp.net, and suddenly my application no longer recognizes the layout file being no longer applying the bootstrap and jquery... How can I fix it??
My layout file is like this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - Aplicação Teste</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("Nome do aplicativo", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
@if (HttpContext.Current.User.IsInRole("Admin"))
{
<li>@Html.ActionLink("Início", "Index", "Home")</li>
<li>@Html.ActionLink("Relatorios", "Relatorios", "Home")</li>
<li>@Html.ActionLink("Cadastros", "Cadastros", "Home")</li>
<li>@Html.ActionLink("Contato", "Contatos", "Home")</li>
}
@if (HttpContext.Current.User.IsInRole("Premium"))
{
<li>@Html.ActionLink("Início", "Index", "Home")</li>
<li>@Html.ActionLink("Sobre", "About", "Home")</li>
<li>@Html.ActionLink("Contato", "Contatos", "Home")</li>
}
else
{
<li>@Html.ActionLink("Sobre", "About", "Home")</li>
}
</ul>
@Html.Partial("_LoginPartial")
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© @DateTime.Now.Year - Projeto Andrêy Ferraz</p>
</footer>
</div>
@Scripts.Render("~/bundles/jquery-3.3.1.js")
@Scripts.Render("~/bundles/bootstrap.js")
@RenderSection("scripts", required: false)
</body>
</html>
While loading the page and pressing F12 appeared the following errors:
GET http://localhost:49866/bundles/jquery-3.3.1.js net::ERR_ABORTED
GET http://localhost:49866/bundles/bootstrap.js net::ERR_ABORTED
GET http://localhost:49866/bundles/jquery-3.3.1.js net::ERR_ABORTED
GET http://localhost:49866/bundles/bootstrap.js 404 (Not Found)
Have you checked the library paths? Check your question, you are confused.
– EmanuelF
Confused, I didn’t understand... look, I will edit the question and put the code of how my layout is... it seems that after I update the Jquery and bootstrap libraries!!
– WPfan
What do you mean "don’t recognize"?
– Jéf Bueno
@LINQ when I run the application it does not load the correct renderings of bootstrap and jquery, that is, the page is as if there is no CSS in it, all disfigured!!
– WPfan
Checks if you are displaying an error message while loading the page. Press F12.
– EmanuelF
@Emanuelf will edit the question and put the error that appeared
– WPfan
You changed the path to this new version of jquery in the file Bundle?
– EmanuelF
Check out that Article: https://msdn.microsoft.com/pt-br/library/dn168847.aspx
– EmanuelF
I read and did not help in much, because apparently everything is ok
– WPfan
put on your Bundleconfig
– Leandro Angelo