ASP.NET 2 login problems

ASP.NET 2 logins caused me a lot of misery recently. All I wanted to do was create a simple website using ASP.NET 2, and implement the standard Forms Authentication. I followed all the instructions in an ASP.NET book I've got, putting in one of the .net 2 Login controls. It all owrked nicely, and then it suddenly stopped and didn't work at all. This is the error message I got:

Your login attempt was not successful. Please try again.

I've had trouble with this sort of thing before, due to the passwords not being right, or something, so I deleted and re-created all the user accounts. I then thought that perhaps the security settings on the ASPNETDB.MDF file had changed, because that is the database that the login info is stored in. But no trouble there either.

Then I started thinking, if it all worked so well earlier, why did it suddenly stop? That's when I realised that I had inadvertantly made a change to the code by double-clicking on the Login control's "Login" button while I was looking at the page in Visual Studio / Visual Web Developer Express. If you double-click on it, you get a "Login1_Authenticate" method being created, and it leaves the method blank, so of course when it tries to authenticate, nothing happens. Duh! So the <ASP:Login> control had been given a [OnAuthenticate="Login1_Authenticate"] parameter, and there was a bogus Authenticate method. I deleted both of these and everything was back to normal. But it caused me to waste half an hour scratching my head.