Managing Scripts for Razor Partial Views and Templates in ASP.NET MVC
UPDATE 13-03-2013: I've created a nuget package for the helpers. The original ScriptContext scope had to be brought back in for MVC 4 as the TemplateStack approach no longer worked.
UPDATE 21-11-2011: After some digging through the MVC framework code, I've come up with a slightly cleaner solution that doesn't require ScriptContext to implement IDisposable and therefore removes the need to create a "scope" for the scripts. Skip to the end to see the update.
The view engine in ASP.NET MVC is flexible, very flexible. With great flexibility comes great responsibility however, and managing JavaScript files and code blocks can be particularly cumbersome in conjunction with partial views and templates.
c# (16)
asp.net mvc (8)
javascript (6)
jquery (5)
search (4)
elasticsearch (4)
nest (3)
openai (2)
async (2)
asynchrony (2)
await (2)
f# (2)
dependency injection (2)
castle windsor (2)
model binding (2)
validation (2)
llm (1)
csharp (1)
ocr (1)
translation (1)
vector search (1)
qdrant (1)
x509 (1)
certificate (1)
ssl (1)
tls (1)
bouncy castle (1)
statiq (1)
github (1)
query (1)
array (1)
internalsvisibleto (1)
dotnet (1)
msbuild (1)
friend assemblies (1)
monitoring (1)
windows (1)
process (1)
procmon (1)
vagrant (1)
winrm (1)
powershell (1)
task parallel library (1)
tpl (1)
gnaf (1)
addresses (1)
australia (1)
sql server (1)
akka (1)
akka.net (1)
reactive (1)
actor model (1)
agents (1)
versioning (1)
optimistic concurrency (1)
geospatial (1)
geojson (1)
geometry (1)
resharper (1)
semanticmerge (1)
git (1)
refactoring (1)
clean code (1)
windows services (1)
topshelf (1)
masstransit (1)
email (1)
acceptance tests (1)
specflow (1)
smtp4dev (1)
bdd (1)
wsfederationauthenticationmodule (1)
classic asp (1)
windows identity foundation (1)
wif (1)
nuget (1)
asp.net web api (1)
parameter binding (1)
csv (1)
valueprovider (1)
signal r (1)
ndc 2012 (1)
conferences (1)
events (1)
razor (1)
continuation passing style (1)
captcha (1)
routing (1)
modelmetadata (1)
podcasts (1)