I made a screwup with the Login control today under ASP.Net 2.0. I was using an ODBC membership provider for all the back-end logic, and drug a login control to the page. The problem, though, was that I then double clicked the control and it added an event-handler for authentication:
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
End Sub
I then created a user using the appropriate controls and tried to login using those credentials; alas, it didn't work. The event handler above got executed, but the membership provider I had registered in the web.config file did not. What happened? As it turned out, having the authenticate event handler above short-circuits the default operation of the login control to hook into the membership provider internals for authentication; and so it just did nothing with it. After deleting the authenticate method (which equates to removing the delegate from the multicast chain) everything worked.
In summary:
1) I added a Login control,
2) Created an Authenticate event handler,
3) The act of creating the event handler short circuited the default operation of the Login control to use the Membership class and its infrastructure.
4) Removing the Authenticate event handler got the Membership class to be used again, and everything worked as expected....
...I'm retarded (and not ashamed to publicly admit it).