twitter bootstrap - MVC 4 Styles.Render & Scripts.Render Clarification -


i'm using asp.net mvc 4 bootstrap , i've noticed project little bit different lot of articles , tutorials "building site bootstrap", keep mention use of minified files of javascript , css (bootstrap.min.css, bootstrap.min.js) , have files without min although files in directory.

i read these files don't point of it, maybe can clarify use of them , if need add reference them in bundle config ?

my code looks :

_layout.cshtml:

<head>     <meta charset="utf-8" />     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>@viewbag.title - asp.net application</title>     @styles.render("~/content/css")     @scripts.render("~/bundles/modernizr")  </head> <body>     <div class="navbar navbar-inverse navbar-fixed-top">         <div class="container">             <div class="navbar-header">                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">                     <span class="icon-bar"></span>                     <span class="icon-bar"></span>                     <span class="icon-bar"></span>                 </button>                  <a href="@url.action("index", "home")" class="navbar-brand">                     <span class="glyphicon glyphicon-filter"></span> selectorit - online                 </a>             </div>             <div class="navbar-collapse collapse">                 <ul class="nav navbar-nav">                     <li>@html.actionlink("home", "index", "home")</li>                     <li>@html.actionlink("about", "about", "home")</li>                     <li>@html.actionlink("contact", "contact", "home")</li>                 </ul>                 @html.partial("_loginpartial")             </div>         </div>     </div>     <div class="container body-content">         @renderbody()         <hr />         <footer>             <p>&copy; @datetime.now.year - asp.net application</p>         </footer>     </div>      @scripts.render("~/bundles/jquery")     @scripts.render("~/bundles/bootstrap")     @rendersection("scripts", required: false) </body> 


, bundleconfig.cs:

public class bundleconfig {     // more information on bundling, visit http://go.microsoft.com/fwlink/?linkid=301862     public static void registerbundles(bundlecollection bundles)     {         bundles.add(new scriptbundle("~/bundles/jquery").include(                     "~/scripts/jquery-{version}.js"));          bundles.add(new scriptbundle("~/bundles/jqueryval").include(                     "~/scripts/jquery.validate*"));          // use development version of modernizr develop , learn from. then, when you're         // ready production, use build tool @ http://modernizr.com pick tests need.         bundles.add(new scriptbundle("~/bundles/modernizr").include(                     "~/scripts/modernizr-*"));          bundles.add(new scriptbundle("~/bundles/bootstrap").include(                   "~/scripts/bootstrap.js",                   "~/scripts/respond.js"));          bundles.add(new stylebundle("~/content/css").include(                   "~/content/bootstrap.css",                   "~/content/site.css"));          // set enableoptimizations false debugging. more information,         // visit http://go.microsoft.com/fwlink/?linkid=301862         bundletable.enableoptimizations = true;     } } 

two questions have :

  1. what missing when don't have reference bootstrap.min.css, bootstrap.min.js ?
  2. should add reference files in the:

    bundles.add(new stylebundle("~/content/css").include()

the min files remove unnecessary characters make file smaller. decreases loading time. source.

if building small personal project, performance might not have high priority. if building site else or organization, suggest using min versions.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -