HTML and CSS Reference
In-Depth Information
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<!-- @Styles.Render("~/Content/themes/base/css", "~/Content/css")
@Scripts.Render("~/bundles/modernizr") -->
</head>
<body>
@RenderBody()
<!-- @Scripts.Render("~/bundles/jquery") -->
@RenderSection("scripts", required: false)
</body>
</html>
Now run the application and the network traffic should look like Figure 5-11 .
Figure 5-11. Network traffic with the standard files removed
A bundle is a set of files that the server concatenates for you. You reference the bundle name in your web
page, and all the individual files are returned in one HTTP request. Visual Studio builds default bundles for you
for all the standard files. However, you might want to create your own custom bundles. You can build a custom
bundle to include just the files you need.
eXerCISe 5-3. CreatING a CUStOM BUNDLe
1.
Visual Studio will only generate bundles when not in Debug mode. This is controlled
by the compilation setting in the web.config file. To enable bundling you'll need
to set this flag manually. Open the web.config file in the root folder and edit the
code shown in bold:
<system.web>
<compilation debug=" false " targetFramework="4.5" />
<authentication mode="Forms">
2.
Open the Global.asax.cs file and change the code to comment out the
RegisterBundles() method line like this:
//BundleConfig.RegisterBundles(BundleTable.Bundles);
 
Search WWH ::




Custom Search