In ASP.NET
Page_Load
event is raised before
btnLogin_Click
event.
When the user click on a button it generate a postback (the page is send back to the web server) and there the events are managed in a standard order.
Here is a
MSDN link[
^] that gives you an overview about ASP.NET Page Life Cycle.
And here is a
starting point link[
^] for creating and working with ASP.NET projects.