Question

Why is the method in Global.asax called Application_Start() and not ApplicationStart()?

According to MSDN method names should be in Pascal case.

Was it helpful?

Solution

This is an event handler, in addition to being a method.
The convention for naming event handlers is EventOrigin_EventName(...). Event origin can be a name of an instance (camel case), or a name of a class (Pascal case), or some other meaningful name (Pascal case). Event name is Pascal case. Underscore between. Visual Studio uses this naming convention when it creates default event names.

emergencyStopButton_PreviewKeyDown(...)
Form_BeforeOpen(...)

related: Naming C# events and handlers

Licensed under: CC-BY-SA with attribution
scroll top