asp.net - How to create a ScriptBundle from dynamically generated content -
i have big javascript file generated dynamically method in controller.
public actionresult geteditingcontext() { string json = jsonconvert.serializeobject(...); return javascript(json); }
the javascript same, user can change settings in admin panel , javascript should updated. thought scriptbundle perfect handle that. automatically check if content has changed , update url script.
the problem don't know how include url in bundle.
i tried :
bundles.add(new tsbundle("~/bundles/editcontext").include( "~/invoice/geteditingcontext"));
but generated script bundle empty, , has no hash. if remove ~ exeption (only application relative urls (~/url) allowed.)
Comments
Post a Comment