I removed two textboxes (textbox_LoginName and textbox_Password) and a button (button_Login) from a LoginView control by cutting and pasting. I placed them within a panel. In the code behind for the login file I removed the FindResource method that I had to use while the controls were buried within the LoginView control. This allowed my to simply use the Text properties of the textboxes as the parameters for the ValidateUser method.
The ValidateUser method was working prior to making the changes. Now, however, when called if the user is a legitimate username and password it returns no user at all - just empty strings/nulls. If the login credentials are incorrect it behaves as normal.
Here is my code:
protected void button_Login_Click(object sender, EventArgs e)
// Validate user against the Membership framework user store.
if (Membership.ValidateUser(textbox_LoginName.Text, textbox_Password.Text))
string myUser = User.Identity.Name;
View Complete Post