Setting passwordStrengthRegularExpression outside of web.config

K

kgray

Is there anyway to set PasswordStrengthRegularExpressionon your
membership provider, without changing the web.config? I would like to
offer the user the ability to change the strength requirement for
their site, but I don't want to do it through the web.config file.
Yet, when I try membership.PasswordStrengthRegularExpression, it is
read-only.

I have found that with appsettings in the web.config, you can create a
seperate file, and set the appsettings to pull that info, ie:
<appSettings file="cfg.xml">. But, the membership provider doesn't
have this option.

Does anyone have any suggestions on how to achieve this?

Thanks in advance, Kathy
 
T

Toze

membership works with providers
so you could create a provider that inherits from the sqlMembbership
provider ( or the provider your using)

create a method in your class that change with reflection the field that
olds PasswordStrengthRegularExpression, change in the web config the the
type of the membership provider to your class
and when you need to change the PasswordStrengthRegularExpression cast the
membership provider to your class and call your method

sorry my bad english
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top