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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -