I am trying to make a simple log in page in ASP.net and this is my code:
protected void Submit1_Click(object sender, EventArgs e)
{
// Validate the user against the Membership framework user store
if (Membership.ValidateUser(UserName.Text, Password.Text))
{
// Log the user into the site
FormsAuthentication.RedirectFromLoginPage(UserName.Text, Persist.Checked);
Response.Redirect("test-records.aspx");
}
// If we reach here, the user's credentials were invalid
Msg.Visible = true;
}
I don't know whats wrong because it shows no error and it just refreshes with no error even the label msg is not visible.