What you want to use is called FormsAuthentication.
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication(v=vs.110).aspx[
^]
With very little code you can make this happen. Essentially change web.config to use FormsAuthentication. This will tell ASP.Net to redirect any unauthenticated requests to your LoginPage. Then in your LoginPage after you have validated the user you write a few lines of code so that ASP.Net knows they are authenticated and then will let them through.
There are many samples online if you just search for FormsAuthentication and C#.