What are advantages of caching?

There are following advantages of caching: Reduce hosting server round-trips When content is cached at the client or in proxies, it cause minimum request to server. Reduce database server round-trips When content is cached at the web server, it can eliminate the database request. Reduce network traffic When content is… Continue reading

What is caching and when to use it?

Caching is a most important aspect of high-performance web application. Caching provides a way of storing frequently accessed data and reusing that data. Practically, this is an effective way for improving web application’s performance. When to use caching Use caching for contents that are accessed frequently. Avoid caching for contents… Continue reading

What are different types of Filters in ASP.NET MVC?

The ASP.NET MVC framework provides five types of filters. Authentication Filters – This filter is introduced with ASP.NET MVC5. The IAuthenticationFilter interface is used to create CustomAuthentication filter. The definition of this interface is given below- public interface IAuthenticationFilter { void OnAuthentication(AuthenticationContext filterContext); void OnAuthenticationChallenge(AuthenticationChallengeContext filterContext); } You can create… Continue reading

What are ASP.NET MVC Filters and Attributes?

ASP.NET MVC provides a simple way to inject your piece of code or logic either before or after an action is executed. This is achieved by decorating the controllers or actions with ASP.NET MVC attributes or custom attributes. An attribute or custom attribute implements the ASP.NET MVC filters (filter interface)… Continue reading

What is Child action and how to invoke it?

Child actions are useful for creating reusable widgets which could be embedded into your views. In ASP.NET MVC partial views are used to create reusable widgets and a partial can be render by an action method. This action method can has child attribute and has its independent MVC lifecycle from… Continue reading

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. protected void Application_Start() { //Register all application Areas AreaRegistration.RegisterAllAreas(); } Always remember the order of registering the Areas must be on top, so that all of the settings, filters… Continue reading

What is Area in ASP.NET MVC?

Areas was introduced in Asp.net 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… Continue reading

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… Continue reading