Cusotm Membership Provider - Custom Error Messages

B

Brett Ossman

I am setting up a custom Membership Provider inheriting from
SQLMembershipProvider. I overrode the ChangePassword method in my provider
and first checks for password re-use. If I simply return False from my
ChangePassword method, the ChangePassword control displays the standard
ChangePasswordFailureText error message. I'm trying display a custom error
message when a password was already used.

Thanks

Brett Ossman
 
P

Pipo

Hi Brett,

You will have to change the ChangePasswordFailureText error message.

Something like this? (Note the PassAlreadyInUse is a boolean you set on the
inherited SQLMembershipProvider)

protected void ChangePassword1_ChangePasswordError(object sender, EventArgs
e)
{
if (mySQLMembershipProvider.PassAlreadyInUse)
{
ChangePassword1.ChangePasswordFailureText = "Password already in use";
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top