Home > Net >  Consult the great spirit of BundleConfig and RouteConfig problem
Consult the great spirit of BundleConfig and RouteConfig problem

Time:10-06

I first time contact ASP.NET MVC, want to consult everybody a great god a question, Global. Asax file code is as follows:
 using System; 
using System.Collections.Generic;
Using System. Linq;
Using System. The Web;
Using System. Web. Mvc;
Using System. Web. Optimization;
Using System. Web. Routing;

The namespace WebApplication3
{
Public class MvcApplication: System. Web. HttpApplication
{
Protected void Application_Start ()
{
AreaRegistration. RegisterAllAreas ();
The FilterConfig. RegisterGlobalFilters (GlobalFilters. Filters);
RouteConfig. RegisterRoutes (RouteTable. Routes);
BundleConfig. RegisterBundles (BundleTable. Bundles);
}
}
}

I have two places don't quite understand:
(1) BundleConfig and RouteConfig file located in the App_Start folder, why global file does not need to add the appropriate folder can directly use the namespace BundleConfig and RouteConfig files,
(2) I also tried to create a new MVC project, then write their own BundleConfig file, finally found the global file cannot be used directly BundleConfig and RouteConfig, you need to add a using WebApplication1. App_Start can use,
Also please the great god can give directions,

CodePudding user response:

Namespace you casually, is not to say that in App_Start folder will App_Start namespace, you new project App_Start folder config is the project name naming space without App_Start, and Global file class the same namespace, can use directly, of course,
  • Related