I have the following problem. My ASP.NET website displays just the index.cshtml without the layout from the _Layout.cshtml.
Here is a simple code example:
_Layout.cshtml:
<!DOCTYPE html>
<html ng-app="myApp">
<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 - Testpage</title>
@Styles.Render("~/Content/css")
</head>
<body layout="column">
<md-toolbar layout="row">
Navigation
</md-toolbar>
<div class="container">
<div ng-view>
</div>
</div>
@Scripts.Render("~/bundles/angular-material")
@Scripts.Render("~/bundles/myapp")
@RenderSection("scripts", required: false)
</body>
</html>
My bundles are defined as follows:
bundles.Add(new ScriptBundle("~/bundles/angular-material").Include(
"~/Scripts/angular.js",
"~/Scripts/angular-animate/angular-animate.js",
"~/Scripts/angular-aria/angular-aria.js",
"~/Scripts/angular-material/angular-material.js"));
bundles.Add(new ScriptBundle("~/bundles/myapp").Include(
"~/Scripts/App/app.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/angular-material.css"));
And the Controller in my MVC:
public class HomeController : Controller
{
public ActionResult Index()
{
return PartialView();
}
}
And last the Index.cshtml:
@{
ViewBag.Title = "Home Page";
}
<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>
</div>
Also the style of bootstrap doesn't work (e.g. class jumbotron). Does anyone have an idea where the problem is?