I hava editor template, let's say date:
@model DateTime @section AdditionalJavaScript2 { } @Html.TextBox("", Model.ToString("dMyyyy"), new { @class = "date" })
Now I would like to put some js code in the HEAD section, but this will not work.
Of course, I have this section in my layout.cshtml:
<head> ... @RenderSection("AdditionalJavaScript2", required: false) </head>
It works from a simple view, but not from a partial view (editor template).
Why?
And is there a workaround?
Thanks,
Igor
source share