469,628 Members | 1,221 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Inherited Membership Provider - Object Reference not set Exception

I added a Company field to the aspNet_Users table and then followed along with
the MSDN docs on How to Implement a Custom Membership User by creating my
inherited class from the SqlMembershipProvider and another inherited from
MembershipUser to contain the new Company field.

In my new Provider class I have overridden the GetUser and CreateUser methods
and overloaded the CreateUser to include my new field as per the MSDN article.

I have overridden the SQLMembershipProvider.Initialize method so I can gain
access to the Connection string after which I call MyBase.Initialize.

I have a simple form with the ASP:Login control and when I attempt to login in I
receive a Configuration Error exception complaining that "Object reference not
set to an instance of an object" that highlights my new Membership provider type
in the Config file.

If I understand all of this correctly my web.config membership section should be
telling the Login control to instantiate my new class and then it calls my
overridden Initialize method and things pick up from there.

Based on the exception I am getting it sounds like the Login control is NOT
instantiating my new class.

<membership defaultProvider="UDSSQLMembershipProvider" hashAlgorithmType="None">
<providers>
<add name="UDSSQLMembershipProvider"
type="UDSSQLMembershipProvider"
connectionStringName="Common"
applicationName="UDSDMS.Demo"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0"
passwordFormat="Clear" />
</providers>
</membership>
Mar 18 '07 #1
0 1357

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John | last post: by
9 posts views Thread by Paul Keegstra | last post: by
3 posts views Thread by ryan.mclean | last post: by
4 posts views Thread by thomas | last post: by
4 posts views Thread by =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post: by
4 posts views Thread by Ben | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.