Using ASP.NET forms authentication, how would you accept an e-mail address and password, use the e-mail address to lookup the username, then log them in with the looked up username and password?
We have this card system which has employee numbers, but no one can remember their numbers. The obvious would be use the e-mail addresses for the login, but the rest of the application depends on the username being the employee number.
Thanks. Code links / examples would be great.
Our current C# solution ends with a null reference exception on:
Response.Write(Membership.GetUser().UserName);
yet both of these work fine:
string userName = Membership.GetUserNameByEmail(emailAddress);
bool successfulLogin = Membership.ValidateUser(userName, password);