I have an HTML form that redirects me to aspx page with a login:
<form method="post" action="../login.aspx">
If the data is correct everything is ok, but when data fail, I need to display an error message, how I can do that?
In the aspx page I have a redirect when everything is ok, but when the login fails y try to put an alert and redirect to my html page, but this not works, the user go to the html page but the alert is not shown:
Response.Redirect("~/Users.aspx"); //here everything is ok
}
}
// if the login is wrong
else
{
Response.Write("<script>alert(the login is wrong);</script>");
Response.Redirect(Request.UrlReferrer.ToString());
}
If the condition is wrong then please insert following code in c# code
ClientScript.RegisterStartupScript(this.GetType(), “myalert”, “alert(‘Your Alert Mesage Here’);”, true);