ASP.NET - Hi All, - Asked By rajesh kokul on 29-Nov-12 02:30 AM

I am using membership in MVC project.

 if (ModelState.IsValid)
           {
               if (Membership.ValidateUser(model.username.Trim(), model.password.Trim()))  
//control goes directly to else from here even i type correct username and password.
                 {
                       FormsAuthentication.SetAuthCookie(model.username, true);
                 }
         }

Please help me...Thank in advance
Hemanth Kumar replied to rajesh kokul on 03-Dec-12 04:25 AM
Hi Rajesh,

I think your code looks clear.Check your code in debug mode.Here are few links which may help you

http://stackoverflow.com/questions/2372889/asp-net-mvc-2-membership-provider-validateuser-return-login-error-messag

http://stackoverflow.com/questions/6530885/changing-membership-validateuser-and-other-things-in-asp-net-mvc-3