How to use remote method to check username and password validation?We are working on MVC.net application where on click login button username and password need to validate on server side. We are using Form authentication over there. Page flow is like this…
JQuery validation plug-in used for client side validation, if client validation pass then make AJAX call to MVC controller to validate username and password. In controller action, we need to pass three parameters Username, Password and RemeberMe. If it is valid then it will return target URL as JSON result and from client side it will redirect to that controller. If it is not valid then show error message.
We write following code for client validation here '.login-form' for form where all these controls are available. I need to write remote method for this but no idea how to write that. Controller Action URL is "Login/ValidateUser" and in post send username, password and remeber
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
focusInvalid: false, // do not focus the last invalid input
**//need to write AJAX call here..**
required: "Username is required.",remote: "Username and password is invalid"
required: "Password is required."