Added the Login and ValidationSummary controls to the default.aspx page of
VS2005 web application. Set the DestinationPageURL to a different "members
only" page, OnAuthenticate to my custom Authenticate event, and
MembershipProvider to my custom provider.
Converted the Login control to a Template and added an additional <asp:Label
AssociatedControlID=Department ...>Department, <asp:TextBox ID=Department
....and <asp:RequiredFieldValidator ControlToValidate=Department ...so I
now have 3 fields to fill in to login. If I don't, the ValidationSummary
control correctly identifies the problem so that all seems to be working.
Created my own Membership Provider, and included a ValidateUser method with
3 string parameters (as well as the usual 2 parameter override), which I
call from the Login1_Authenticate event.
Trouble is, I can't seem to get the 2 things to work together.
If I remove the OnAuthenticate then it correctly goes to the
ValidateUser(string, string) of my custom Provider, but if I include the
OnAuthenticate then it goes to the event OK, but how do I call the custom
ValidateUser method?
Hopefully someone can post the code that goes in the event -
protected void Login1_Authenticate(object sender, AuthenticatedEventArgs e)
{
/* Authenticate using myProvider.ValidateUser(userName, password,
department) somehow? */
}