How to register Area in ASP.NET MVC?

Before working with area, make sure you have registered your area with in the Application_Start method in Global.asax as shown below.

Always remember the order of registering the Areas must be on top, so that all of the settings, filters and routes registered for the applications will also apply on the Areas.

What is Area in ASP.NET MVC?

Areas was introduced in MVC2 which allow us to organize models, views, and controllers into separate functional sections of the application, such as administration, billing, customer support, and so on. This is very helpful in a large web application, where all the controllers, views, and models have a single set of folders and that become difficult to manage. Each MVC area has its own folder structure which allow us to keep separate controllers, views, and models. This also helps the multiple developers to work on the same web application without interfere to one another.

What are different ways of rendering a Partial View in ASP.NET MVC?

There are four methods for rendering a partial view in ASP.NET MVC These are RenderPartial, RenderAction, Partial and Action helper methods. Html.RenderPartial This method result will be directly written to the HTTP response stream means it used the same TextWriter object as used in the current webpage/template. This method returns void. Simple to use and no need to create any action. RenderPartial method is useful used when the displaying data in the partial view is already in the corresponding view model. For example: In a blog to show comments of an article, we would like to use RenderPartial method since … Click here to continue…..

What is Partial View in ASP.NET MVC?

A partial view is like as user control in ASP.NET Web forms that is used for code re-usability. Partial views helps us to reduce code duplication. Hence partial views are reusable views like as Header and Footer views. We can use partial view to display blog comments, product category, social bookmarks buttons, a dynamic ticker, calendar etc. It is best practice to create partial view in the shared folder and partial view name is preceded by “_”, but it is not mandatory. The “_” before view name specify that it is a reusable component i.e. partial view.

How Bundling use browser Cache capability?

Browsers cache resources based on URLs. When a web page requests a resource, the browser first checks its cache to see if there is a resource with the matched URL. If yes, then it simply uses the cached copy instead of fetching a new one from server. Hence whenever you change the content of CSS and JS files will not reflect on the browser. For this you need to force the browser for refreshing/reloading. But bundles automatically takes care of this problem by adding a hash code to each bundle as a query parameter to the URL as shown below. … Click here to continue…..