razor - Bundling scripts are not getting rendered -
I am having problems with script bundling and minimization with ASP.NET, I try all the popular solutions found on the internet But still the same problem.
Looks like my and in the master view: After all this when I run I get this tag: "? / Script V = ZnxC8Dcoc3fJ-hfKQHLiTe19PjJFHwPhwHPUncuBtzE1" And using Chrome Code Inspector I have found that the status code for the above resource is and I can not even see the script file by clicking on the view source, it seems that nothing is loading But all files and directories are kept correctly, just for information, make my stylesheet Sex is working fine. Please help Thanks. You can not give your bundle a name which is also the name of the current directory. Rename the bundle or add and any other name Does not exist, like ... assume that you do not have the BundleConfig.cs
name space MYPROJ {public class BundleConfig {public static void AddDefaultIgnorePatterns (IgnoreList ignoreList) {if (Ignore list == empty) return; IgnoreList.Ignore ("* intellisense.js."); IgnoreList.Ignore ("* - vsdoc.js"); Ignore list ("* .debug.js", optimization mode. When enabled); Ignore list ("*. Min.js", optimization mode. When disabled); Ignore list ("* .min.css", optimization mode. When disabled); } Public Static Zero Register Bundle (Bundle Collection Bundle) {Bundle. Unknown list Clear (); AddDefaultIgnorePatterns (bundles.IgnoreList); Add bundle (add new scriptbundle ("~ / bundle / jquery"). ("~ / Scripts / jquery- {version} .js")); One ?? | Â ?? |. //bundles.Add(new ScriptBundle ("~ / script") ("~ / script / jquery.unobtrusive-ajax.min.js" "~ / script / kendoui / kendo .all.min.js" "~ / Script / kendoui / kendo.combobox.min.js "" ~ ~ / script / kendoui / kendo.grid.min.js ")); Include //bundles.Add (new scriptbundle ("~ / script"). ("~ / / Scripts / kendui / kendo.lm.in"); Include //bundles.Add (new scriptbundle ("~ / script"). ("~ / Scripts / kandui / kendo.com .bobox.man")); Include //bundles.Add (new scriptbundle ("~ / script"). Include ("~ / script / kandui / kendo.grid.money.js")); IncludeDirectory ("~ / script / kendoui", "* .js") ..); bundles.Add (New ScriptBundle ("~ / script") IncludeDirectory ("~ / script" "* .js");); One ?? | | ?? | | Bundledable.config optimization = true; }}}
@ scripts.Render ("~ / scripts")
& lt script src = & gt; & Lt; / Script & gt;
status code: 302 found and
scripts / < / Code> this is the
status code: 404 not found
/ js to make it work properly: Add bundles (new scriptbundle ("~ / scripts / js"). Include directory ("~ / script", "* .js"). Include directory ("~ / scripts / kendui", "* .js"));
@ Scripts.Render ("~ / scripts / js")
bundles. Include directory ("~ / script / kandui", "* .js"); Add (New scriptbundle ("~ / ScriptMonkey") directory ("~ / scripts", "* .js"));
/ ScriptMonkey directory.
Comments
Post a Comment