HTML and CSS Reference
In-Depth Information
<!DOCTYPE html>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<!-- @Styles.Render("~/Content/themes/base/css", "~/Content/css")
@Scripts.Render("~/bundles/modernizr") -->
<!-- @Scripts.Render("~/bundles/jquery") -->
@RenderSection("scripts", required: false)
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
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:
<compilation debug=" false " targetFramework="4.5" />
<authentication mode="Forms">
Open the Global.asax.cs file and change the code to comment out the
RegisterBundles() method line like this:
Search WWH ::

Custom Search