Is there a way to disable ASP.Net membership provider from using a web.config?
Currently it stores a connection string and a sqlMembershipProvider in a web.config which is not where i’d like it to be.
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can typically use a provider just after calling its default constructor and call
Initializeon it. However, it is impossible to use theSystem.Web.Security.Membershipabstraction, without the web.config, because theMembershipclass is hard-wired to the configuration file. When using theMembershipclass, it will instantiate types that you configured in the configuration file.As I said, when you don’t want to configure it in the configuration file, you can create it in code. This would be a nice approach, especially when you have your own IoC framework (you could see the
Membershipfacade as an IoC implementation just for types deriving fromMembershipProvider). Here is an example of how for create aSqlMembershipProvider:Good luck.