ASP.NET: How to detect if user is locked out when using a LoginControl

I use a LoginControl and a custom membership provider for my web site. That works fine - I have only one question. If I set IsLockedOut=1 in table aspnet_Membership for a user and this user tries to login I would like to show a different message than the normal failure message.

So basically I need to find out about the reason of failure in the LoginError callback. Does anyone know how I can do that?

Regards,
Dirk.
dirkil2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
You need to hancle LoginError Event of login control.
Here is the exact example you need: http://www.4guysfromrolla.com/articles/050306-1.aspx
In case if you need C#: http://www.carlosag.net/Tools/CodeTranslator/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dirkil2Author Commented:
What I was missing was the following line:

MembershipUser user = Membership.GetUser(Login1.UserName);

I wasn't aware that you can still get access to the user in that case.

Thanks for giving me that interesting link.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.