How to add Global.asax page to asp.net 4.5 version in C#? -


i have put css , javascript files reference in aspx page bundle(global.asax )file in 2013(4.5 version) visual studio. how can it?

try :

bundles.add(new stylebundle("~/allstyles").includedirectory("~/images","img.css")                              .includedirectory("~/content","con.css")                              .include("~/styles.css")) 

in view page:

<%: styles.render("~/allstyles") %> 

or

bundles.add(new stylebundle("~/bundles/img").include("~/images/img.css")) bundles.add(new stylebundle("~/bundles/content").include("~/content/con.css")) bundles.add(new stylebundle("~/bundles/style").include("~/styles.css")) 

in view page:

<%: styles.render("~/bundles/img","~/bundles/content","~/bundles/style") %> 

and remind must add in global.asax.cs file bundleconfig.registerbundles(bundletable.bundles);


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -