Can the application run Without using Global.asax file in ASP.Net And Asp.Net MVC? [Resolved]

Posted by Kumarkrishna184 under ASP.NET MVC on 4/7/2016 | Points: 10 | Views : 7064 | Status : [Member] | Replies : 2
Can the application run Without using Global.asax file in ASP.Net And Asp.Net MVC?
If yes then how and if no then why?

Thanks,

Thanks and Regards,
Krishna Kumar



Responses

Posted by: Sheonarayan on: 4/7/2016 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
In ASP.NET MVC
Can't as in Global.asax we have Application_Start event that contains the registration of Areas, FilterConfig, RouteConfig and BundleConfig. If you remove this, the configuration is removed and the application doesn't run.

protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}

In ASP.NET
Same as the case ASP.NET application latest version.
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}


So now we can say that without global.asax, an asp.net application can't run. Earlier, it was possible.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kumarkrishna184 on: 4/8/2016 [Member] Starter | Points: 25

Up
0
Down
Thanks Sir,

Thanks and Regards,
Krishna Kumar

Kumarkrishna184, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response