Its because you have not set the session variable.
Just do one thing.make a login page with username in textbox1
Create a Session variable then
Then Session["username"]=textbox1.text;
Then on click of login when you redirect to other page in that page_load event put
page_load()
{
if(Session["username"]!=null)
{
}
else
{
Response.Redirect("Login.aspx");
}
}
Hope it helps...