I have a question with a newbie .net.
Where would be a good place to write code that runs globally before loading each page? Some of the operations that I will do are as follows:
a) open a database connection b) check the session to see if the user is logged in c) it is possible to initialize several objects
I thought about this in the main file, but was not sure if this is a good idea. And, perhaps, for each of these operations, there may be a function in .Net that does this already, so I don’t need to “reinvent” the wheel.
source share