Welcome Guest! To enable all features please Login or Register.
Options
View
Go to last post Go to first unread
Offline MichaelKB  
#1 Posted : 07 June 2018 02:40:16(UTC)
MichaelKB


Rank: YAF Forumling

Reputation:

Joined: 30/05/2018(UTC)
Posts: 8
United States
Location: Tulsa, Oklahoma

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
Sponsor
Offline MichaelKB  
#2 Posted : 08 June 2018 23:58:33(UTC)
MichaelKB


Rank: YAF Forumling

Reputation:

Joined: 30/05/2018(UTC)
Posts: 8
United States
Location: Tulsa, Oklahoma

Ideas anyone?
Offline MichaelKB  
#3 Posted : 10 June 2018 16:58:11(UTC)
MichaelKB


Rank: YAF Forumling

Reputation:

Joined: 30/05/2018(UTC)
Posts: 8
United States
Location: Tulsa, Oklahoma

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
Offline MichaelKB  
#4 Posted : 11 June 2018 14:53:46(UTC)
MichaelKB


Rank: YAF Forumling

Reputation:

Joined: 30/05/2018(UTC)
Posts: 8
United States
Location: Tulsa, Oklahoma

Finally got this fixed. Thnx
Rss Feed  Atom Feed
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.

Notification

Icon
Error