- I have a partial view which contains javascript specific only to said view
- Apparently, ASP.NET MVC does not support sections in partial views, so I cannot add a script section to my partial to be added to the end of my layout page
- I came upon this question which proposes a promising-looking set of extensions, but it requires that I put the javascript in a separate .js file.
- So I did that only to find that the Razor syntax in the original javascript won't work there.
- I then happened upon a VS plugin called RazorJS, but it doesn't appear to have been updated since 2011, so I am not even going to give it a go.
So it appears my only option is to host my javascript in a view, but I need to be able to inject it into the view from a partial view. Any way to do this?