In _Layout.cshtml I have the following defined in the tag:
@RenderSection("JavaScript", required: false);
The whole thing looks like this:
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
@RenderSection("JavaScript", required: false);
</head>
Now in a view’s Index.cshtml I have:
@section JavaScript
{
<style type="text/css" title="currentStyle">
@@import "table/media/css/demo_page.css";
@@import "table/media/css/demo_table.css";
</style>
}
But on the line that ‘element style must not be nested in element style’.
Not sure why this is, anyone have any ideas?
Normally you should use
urlwith@import:or use the
linktag withhref: