Custom Profile provider is null

G

Guest

I've implemented a custom profile provider following the pattern and examples
provided with ASP.NET 2.0, but no Profile object ever appears in my page; that
is, after executing the following,

ProfileCommon profile = this.Profile;

in my Page_Load method, profile is always null. My web.config file contains
the
following section:

<profile enabled="true" defaultProvider="UserProfileProvider">
<properties>
<add name="ShowItems" type="System.Boolean" defaultValue="false" />
</properties>
<providers>
<add name="UserProfileProvider"
type="Utilities.UserProfileProvider, Utilities"
applicationName="/"
description="User profile provider" />
</providers>
</profile>

The Utilities assembly is in place, and Intellisense offers the ShowItems
property of profile as a bool, as expected, so the web.config file is being
parsed. Utilities.UserProfileProvider inherits directly from ProfileProvider;
the only members for which I'm providing any real implementation (at this
point)
are GetPropertyValues and SetPropertyValues.

What else should I be doing? Is anything needed in Global.asax to get things
going?

TIA...

--Rich Armstrong
 
S

Steven Cheng[MSFT]

Hi Rich,

Thank you for posting.

As for the profile provider problem, have you checked the web.config to see
whether the profile service for the application is disabled. Also, since
the application dosn't report error at initlize time(parsing the
web.conifig), I think your custom provider class has been correctly
idenitified and loaded. You can use the following code to loop all the
profile providers currently available for the application:

foreach (ProfileProvider pp in ProfileManager.Providers)
{
Response.Write("<br/>" + pp.Name + ": " + pp.Description);
}

this can also help ensure whether the custom provider is correctly
configured.

Please feel free to post here if threre's any other finding.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

... have you checked the web.config to see whether the profile service for
the application is disabled

Exactly what do you mean by this? As you can see from my original post, my
web.config includes <profile enabled="true"
defaultProvider="UserProfileProvider">. Where else does one modify web.config
so as to see if "the profile service for the application is disabled" or
enabled?
 
S

Steven Cheng[MSFT]

Thanks for the followup Rich,

I just mean that setting, so you've already enabled that. Then, how about
the results you print through the following statement?

foreach (ProfileProvider pp in ProfileManager.Providers)
{
Response.Write("<br/>" + pp.Name + ": " + pp.Description);
}


Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top