Writing to head, but not via _Layout.cshtml
You can do this by using sections. Go to your _Layout.cshtml and add a new section called head like this:
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
@RenderSection("head", false)
</head>
The new section is added with the @RenderSection. Now in your individual views you can add content to the head like this:
@section head
{
<script type="text/javascript">
//Your java script here
</script>
}
When the complete view is rendered the javascript would be rendered in the head section just below the link tag. You could put anything in there. For example, meta tags.