I’m trying to create Global.asax in a Winform. I could do it in ASP.NET, but i couldn’t find a way for Windows Application. Any help will be appreciated.
I have a singleton class called DataAccessLayer, i need to instantiate it once only, so i can call its method/properties anywhere in the application easily.
You cannot add a
Global.asaxto a winform application in the same way that you cannot add anaspxpage it. They are parts of webforms.The purpose of
Global.asaxis to define application and session events and objects. You can do this from theMain()method of you winform application.