I have a simple custom layout with a background image (PaintLayout.cshtml):
<head>
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<link href="/Content/PaintStyles.css" rel="stylesheet" type="text/css" />
</head>
<body style="background: url('Images/PaintBackgroundSM.png')">
<div id="header">
<h1>@ViewBag.Headline</h1>
</div>
<div>
@RenderBody()
</div>
</body>
The Index.cshtml shows the image just fine
@{
Layout = "~/Views/Shared/PaintLayout.cshtml";
}
<div style="text-align:center">
<h1>@ViewBag.Message</h1>
</div>
but the View does not. It does, however, get the rest of the css from PaintStyles.css, just not the image from the layout
@{
Layout = "~/Views/Shared/PaintLayout.cshtml";
}
<div>
<h2>ShowDetail</h2>
</div>
I have tried several variations on the path to the image. The one I'm using is the only one that works even on the Index.cshtml. My Images folder is in the root, where the template put it. My Index and view are both in the same path under Views\Paint.