protected void LoginButtonClickPerformed(object sender, EventArgs e) { Admin admin = new Admin { UserName = txtUsername.Text, password = txtPassword.Text }; ECommerceBusiness ecb = new ECommerceBusiness { AdminObj = admin }; DataTable dt = ecb.SelectAdmin(); if (dt.Rows.Count > 0) { Session["Fullname"] = dt.Rows[0]["FullName"].ToString(); Session["Username"] = dt.Rows[0]["username"].ToString(); Session["Password"] = dt.Rows[0]["Password"].ToString(); Session["Image"] = dt.Rows[0]["ImageUrl"].ToString(); Session["AdminSession"] = "Admin"; Response.Redirect("~/admin/ControlBusiness.aspx"); } else { lblStatus.Text = "Username or password not matched !"; } }