Last post Apr 29, 2014 08:02 AM by seamus1982
Apr 29, 2014 07:45 AM|seamus1982|LINK
I have a database that cannot be changed and I am trying to implement membership from it. I am creating a MVC application and I have created a class that inherits from MembershipProvider. I have overridden a number of methods as described in a tutorial.
There is a View called login and when this page is called. This is the code in the controller
public ActionResult Login(LoginModel model, string returnUrl)
if (ModelState.IsValid && Membership.ValidateUser(model.UserName, model.Password))
ModelState.AddModelError("", "The user name and password provided is incorrect.");
This executes fine but for some reason the user is not logged in. The validateuser method is as below
public override bool ValidateUser(string username, string password)
SEAIInventory.inventoryEntities1.Linq.LinqMetaData context = new SEAIInventory.inventoryEntities1.Linq.LinqMetaData();
var user = (from c in context.Customer
where c.Username == username && c.Password == password
if (user == 0)
But I don't understand where the user is said to be logged in in this method.
Any help would really be appreciated.
Apr 29, 2014 08:02 AM|seamus1982|LINK
I forgot to log the user in.