Hello
i want to know how to create login page in asp.net help of jquery and ajax function
I am sure I got an answer in this .c-sharpcorner
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ankit ShuklaPosted Jul 27, 2021, 11:29 AM
Sundaram SubramanianPosted Jun 22, 2017, 12:18 AM
usingSystem.Configuration;usingSystem.Data.SqlClient;usingSystem.Data;[System.Web.Services.WebMethod][System.Web.Script.Services.ScriptMethod]publicstaticstringValidateUser(Users user){intuserId = 0;stringconstr = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;using(SqlConnection con =newSqlConnection(constr)){using(SqlCommand cmd =newSqlCommand("Validate_User")){cmd.CommandType = CommandType.StoredProcedure;cmd.Parameters.AddWithValue("@Username", user.Username);cmd.Parameters.AddWithValue("@Password", user.Password);cmd.Connection = con;con.Open();userId = Convert.ToInt32(cmd.ExecuteScalar());con.Close();}}stringIsValidate =string.Empty;switch(userId){case-1:IsValidate ="Username and/or password is incorrect.";break;case-2:IsValidate ="Account has not been activated.";break;case-3:IsValidate ="Login Successfully.";break;}returnIsValidate;}publicclassUsers{publicstringUsername {get;set; }publicstringPassword {get;set; }}}Thiruppathi RPosted Jun 21, 2017, 10:20 PM
Manikandan MurugesanPosted Jun 21, 2017, 8:25 PM