By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

Custom Profile provider is null

P: n/a
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
Mar 30 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.)




Mar 30 '06 #2

P: n/a
>> ... 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?
--
Rich Armstrong

May 2 '06 #3

P: n/a
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.)

May 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.