In previous chapter you learnt how to add BundleConfig, FilterConfig and RouteConfig in your MVC project. In this part of tutorial you will see how to register them in Global.asax file.
Registering these configs to global file is very easy. Simply add below code to global.asax file and it will do rest of your job.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
namespace DotNetConceptCreateMyFirstMVCProject
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
Till here you have registered Routing, Bundling and Filters to global.asax file. In next part of tutorial you will learn setting web.config file for MVC poject.