Custom Profile Access
We have successful setup our custom Membership and role providers as directed here: www.sitefinity.com/.../using_the_asp_net_sql_membership_provider_in_sitefinity.aspx
But we can not figure out how to use our custom profile the default profile instead of Sitefnity's profile provider.
Is this possible? If not how can we reference our provider instead?
In our web.config the profile is registered.
<
profile
inherits
=
"SitefinityWebApp.Code.HTSProfile"
defaultProvider
=
"AspNetSqlProfileProvider"
enabled
=
"true"
>
<
providers
>
<
clear
/>
<
add
name
=
"AspNetSqlProfileProvider"
type
=
"System.Web.Profile.SqlProfileProvider"
connectionStringName
=
"HTSLogin"
applicationName
=
"/"
/>
</
providers
>
</
profile
>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Profile;
using System.Web.Security;
namespace SitefinityWebApp.Code
public class HTSProfile : ProfileBase
public static HTSProfile GetUserProfile(string username)
return Create(username) as HTSProfile;
public static HTSProfile GetUserProfile()
return Create(Membership.GetUser().UserName) as HTSProfile;
[SettingsAllowAnonymous(false)]
public string FirstName
get return base["FirstName"] as string;
set base["FirstName"] = value;
[SettingsAllowAnonymous(false)]
public string LastName
get return base["LastName"] as string;
set base["LastName"] = value;
[SettingsAllowAnonymous(false)]
public string StreetAddress
get return base["StreetAddress"] as string;
set base["StreetAddress"] = value;
[SettingsAllowAnonymous(false)]
public string City
get return base["City"] as string;
set base["City"] = value;
[SettingsAllowAnonymous(false)]
public string State
get return base["State"] as string;
set base["State"] = value;
[SettingsAllowAnonymous(false)]
public string Zip
get return base["Zip"] as string;
set base["Zip"] = value;
[SettingsAllowAnonymous(false)]
public string Telephone
get return base["Telephone"] as string;
set base["Telephone"] = value;
[SettingsAllowAnonymous(false)]
public string Ssn
get return base["Ssn"] as string;
set base["Ssn"] = value;
[SettingsAllowAnonymous(false)]
public string DateOfBirth
get return base["DateOfBirth"] as string;
set base["DateOfBirth"] = value;
Hello Aaron,
Unfortunately we do not have ASP.NET profile provider wrappers. And our profiles implementation kind of overrides the default profile implementation, so basically I recommend you to use our Profiles instead of the built-in ones.
Regards,