ASP.Net MVC 4 interview questions with answers: – What is Bundling and minification in Model view controller ?

In case you are new to MVC ( Model view controller) , you start seeing our videos on MVC by clicking the link  ASP.NET ( MVC ) Model view controller videos

As a web developer you may have created many Javascript and Css files. Many times to improve the modularity, readability and maintainability of the project we break single CSS/JS files into multiple files. This is an actually a good practice but performance wise bad practice.

In MVC 4 two small but useful features are introduced called, Bundling and Minification which make our website perform faster.

Bundlinglet us combine multiple javascript and css files into single element and that’s why just by a single a request we get multiple files.

Minification reduced the size of the file by minifying the content (i.e. removing not required blank spaces, removing comments, reducing identifiers). This is done at runtime. Because it also removes stuffs which are browser specific, for example if request is coming from IE it removes all Mozilla specific stuffs.

Steps for Bundling and Minification

1. Open BundleConfig.cs File


2. In RegisterBundles write following code

publicstaticvoidRegisterBundles(BundleCollection bundles)


3.  Now in your View, instead of referencing individual files refer the bundle

<%=Scripts.Render(“~/jquery”) %>
<%=Scripts.Render(“~/css”) %>

Peformance Test using IE Developer tools





Also do have a look on below video ASP.NET MVC Model view controller ( MVC) Step by Step Part 1:-

Thanks to for providing this ASP.NET MVC interview question with answer.


About c# and .NET Interview questions

This blog is for developers who want to crack .NET and C# interviews. It has all tips and tricks needed to crack .NET interviews , C# interview , SQL Server interview , Java interview , WCF Interview , Silverlight interview , WPF interview , LINQ interview , Entity framework Interview. Do not forget to watch our Learn step by step video series. Learn MVC in 16 hours:- Learn AngularJS Step by Step:- Learn Design Pattern in 8 hours:- Learn C# and .NET in 60 days:- Learn MSBI in 32 hours:- Learn SharePoint Step by Step in 8 hours:-
This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

One Response to ASP.Net MVC 4 interview questions with answers: – What is Bundling and minification in Model view controller ?

  1. OP says:

    Hi Guys,
    Nice article but little bit you have missed.
    instead of

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s