Another possibility that will take me a few more minutes to write up:
Create an extension method for HtmlHelper. In your cshtml file it would look like this:
@Html.InlineScriptBlock("~/scripts/small_script_block1.js")
If you want I can send you the implementation but that idea might be all you need. If not, add a comment and I'll write it up.
EDIT CODE Below (not pretty and no warranty implied or given :)
public static class HtmlHelperExtensions
{
public static MvcHtmlString InlineScriptBlock<TModel>(this HtmlHelper<TModel> htmlHelper, string path)
{
var builder = new TagBuilder("script");
builder.Attributes.Add("type", "text/javascript");
var physicalPath = htmlHelper.ViewContext.RequestContext.HttpContext.Server.MapPath(path);
if (File.Exists(physicalPath))
{
builder.InnerHtml = File.ReadAllText(physicalPath);
}
return MvcHtmlString.Create(builder.ToString());
}
}
Keep in mind that if you drop this into your project you will need to make the namespace visible to the views. Unlike ASP.NET WebForms where you could provide markup at the top, Razor requires you to do this in the Web.config file in the Views folder.
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Your.Namespace.Here.Extensions" />
</namespaces>
</pages>