You need to create a session when there is a successful login in the first page like-
if({expression to check if login successful})
{
Session["UserId"]=UserId;
}
Then in the second page, in page_load event you can put a check like-
protected void Page_Load(object sender, EventArgs e)
{
If(Session["UserId"]==null)
}
Hope, it helps :)