0

When I click on login button it is not redirecting to the verify function why?? when I submit data in Login form it is not redirecting to verify method in order to validate login credentials

Note: I am using MVC

This is My code

@{
    ViewBag.Title = "Login";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Login Page</h2>
<div>
    <form action="Verify" method="post">
        <div>
            <label>UserName</label>
            <input type="text" name="UserName" placeholder="Enter Username" required="" />
        </div>
        <div>
            <label>Password</label>
            <input type="password" name="Password" placeholder="Enter Password" required="" />
        </div>
        <div>
            <input type="button" strong text value="LogIn" />
        </div>

    </form>
    </div>
 [HttpPost]
        public ActionResult Verify(Account accObj)
        {
            ConnectionString();
            conObj.Open();
            cmdObj.Connection=conObj;
            cmdObj.CommandText="select * from LoginDetails where username='"+accObj.UserName+"' and password='"+accObj.Password+"'";
            dr = cmdObj.ExecuteReader();
            if(dr.Read())
            {
                conObj.Close();
                return View("Create");
            }
            else
            {
                conObj.Close();
                return View("Error");
            }

        }

0 Answers0