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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manikandan MurugesanRank #300 · 8.4K reputationPosted Jun 21, 2017, 4:25 PM EDT
Thiruppathi RRank #404 · 6.2K reputationPosted Jun 21, 2017, 6:20 PM EDT
Sundaram SubramanianRank #150 · 15.2K reputationPosted Jun 21, 2017, 8:18 PM EDT
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; }}}Ankit Shukla50 reputationPosted Jul 27, 2021, 7:29 AM EDT