First off I'd suggest using Membership or Identity as you'll get all this out of the box. But if this is for learning then add a global.asax file to the solution and use the BeginRequest event to check if the user has logged in
<%@ Application Language="C#" %>
<script runat="server">
void Application_BeginRequest(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(Session["Username"])
{
Response.Redirect("/Login.aspx")
}
}
</script>