I\'ve had to create a custom membership provider for my current ASP .Net project in order to fit in with our database schema, and am having problems configuring it to lockout a
Replicate the conditions that lead to lockout (too many bad login attempts). Because Membership providers make a trip to their backend every time, it is sensible to limit this approach to providers with reasonable number of MaxInvalidPasswordAttempts.
if (0 < Membership.MaxInvalidPasswordAttempts && Membership.MaxInvalidPasswordAttempts < 100)
{
for(int i = 0; i <= Membership.MaxInvalidPasswordAttempts; i++)
{
Membership.ValidateUser(userName, "jfdlsjflksjlkfjsdlkfjsdl");
}
}