protected void btnLogin_Click(object sender, EventArgs e)
{
bool IsFound = false;
clsDataLayer dl = new clsDataLayer();
IsFound = dl.GetUser(Server.MapPath("~/AddressBook.mdb"), txtUserId.Text, txtPassword.Text); // Verify that your AddressBook.mdb path is correct!!!!
if (IsFound)
{
Response.Redirect("~/frmUpdateAddress.aspx");
}
else
{
int myAttempts = Convert.ToInt32(Session["AttemptCount"]);
myAttempts = myAttempts + 1;
Session["AttemptCount"] = myAttempts;
lblStatus.Text = "The User ID and/or Password supplied is incorrect. Please try again!";
if (myAttempts >= 3)
{
// *********************************
// add your code here to update the user record in the database
// to reflect that the user account is 'locked
// *********************************
lblStatus.Text = "Your account is disabled.";
}
}
}