Welcome Guest! To enable all features please
Login or Register.
Hope all is well! I have a quick question (I think?) I'm trying to extend the YafuserProfile so that I can add some more properties. When I try to reference it the "base" is always null.
My extension:
namespace TradeInsights.Framework
{
public class TraderProfile : YafUserProfile
{
static public TraderProfile CurrentUser
{
get
{
return (TraderProfile)(YafUserProfile.Create(Membership.GetUser().UserName));
}
}
public static new TraderProfile GetProfile(string username)
{
return Create(username) as TraderProfile;
}
public static TraderProfile GetProfile()
{
return Create(Membership.GetUser().UserName) as TraderProfile;
}
[SettingsAllowAnonymous(false)]
public virtual string Referrer
{
get { return ((string)(base["Referrer"])); }
set { base["Referrer"] = value; Save(); } (NULL issue here, that thing is non-existent)
}
}
}
My web.config:
<profile enabled="true" defaultProvider="YafProfileProvider" inherits="TradeInsights.Framework.TraderProfile">
<providers>
<clear />
<add name="YafProfileProvider" applicationName="TradeInsights" connectionStringName="yafnet" type="YAF.Providers.Profile.YafProfileProvider" />
</providers>
</profile>
I'm probably missing something obvious but I've never done anything with membership. Thank you in advanced for any input you can offer!
Michael
I also get this whenever I try to view a user profile or even view a post. Related?
[NullReferenceException: Object reference not set to an instance of an object.]
YAF.Providers.Profile.YafProfileProvider.LoadFromPropertyCollection(SettingsPropertyCollection collection) +281
YAF.Providers.Profile.YafProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection) +293
System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +303
System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +202
System.Configuration.SettingsBase.get_Item(String propertyName) +118
System.Web.Profile.ProfileBase.GetInternal(String propertyName) +46
System.Web.Profile.ProfileBase.get_Item(String propertyName) +89
YAF.Utils.YafUserProfile.get_Homepage() +21
YAF.Controls.DisplayPostFooter.DisplayPostFooter_PreRender(Object sender, EventArgs e) +2071
System.Web.UI.Control.OnPreRender(EventArgs e) +11897599
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Control.PreRenderRecursiveInternal() +255
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6874
Finally got this fixed. Thnx
Forum Jump
- You cannot post new topics in this forum.
- You cannot reply to topics in this forum.
- You cannot delete your posts in this forum.
- You cannot edit your posts in this forum.
- You cannot create polls in this forum.
- You cannot vote in polls in this forum.
Important Information:
The YAF.NET Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close