Shouldn't PostBack be checked before Session
protected void Page_Load(object sender, EventArgs e)
{
if (Session["login"] != null && Session["login"].ToString() == "1")
{
if (!IsPostBack)
{
LoadData();
}
}
else
{
Response.Redirect("login.aspx");
}
}