我已经完成了 MembershipProvider 的自定义实现,但由于某种原因,初始化方法没有被调用,因此我的提供者没有从配置参数正确设置,谁首先调用它,我如何让它工作。
Addi
问问题
1157 次
1 回答
1
I assume this is an ASP.NET application. Do you have a reference to your membership provider in your web.config (it can also be in your machine.config, but this is lesser used)?
You should have something like the following in the system.web section of your web.config:
<membership defaultProvider="MyCustomMembershipProvider">
<providers>
<clear/>
<add
name="MyCustomMembershipProvider"
type="MyNamespace.MyCustomMembershipProvider"
connectionStringName="..." ... />
</providers>
</membership>
Make sure also that your provider is inheriting from the System.Web.Security.MembershipProvider abstract class.
See this MSDN article for more detail and examples.
于 2008-10-01T21:53:51.293 回答