#1
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
Topic Starter
  • MichaelKB
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    54.8%
  • Joined: 30/05/2018
  • Posts: 8
  •  United States
  • Location: Tulsa, Oklahoma
#2
Ideas anyone?
Topic Starter
  • MichaelKB
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    54.8%
  • Joined: 30/05/2018
  • Posts: 8
  •  United States
  • Location: Tulsa, Oklahoma
#3
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
Topic Starter
  • MichaelKB
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    54.8%
  • Joined: 30/05/2018
  • Posts: 8
  •  United States
  • Location: Tulsa, Oklahoma
#4
Finally got this fixed. Thnx
Topic Starter
  • MichaelKB
  • Rank: YAF Forumling
  • Reputation:
    Neutral
    54.8%
  • Joined: 30/05/2018
  • Posts: 8
  •  United States
  • Location: Tulsa, Oklahoma
Users browsing this topic

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.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved