Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jdelagoutte 13 posts 26 karma points
    Sep 09, 2009 @ 09:23
    jdelagoutte
    0

    GetCurrentMember : xslt vs C# : caching

    Hi All,

     

    I have a first page, calling a C# usercontrol, where a user can change his personnal informations.

    It contains a Save button, that update the properties (those value can be seen in the database) and, to force uncaching,  finish by

    Member.RemoveMemberFromCache(Member.CurrentMemberId());
    Member.AddMemberToCache(Member.GetCurrentMember());

    I've checked that Member.GetCurrentMember create a new Member from the database if it is not found in the cache. So, I expect to have the new member with its new properties in the cache now.

     

    Then, the user is redirected to an other page, which call a xslt file for displaying some personnal informations (name, ...):

    <xsl:variable name="member" select="umbraco.library:GetCurrentMember()"/>
    <xsl:value-of select="$member/data[@alias='memberFirstName']"/>
    &nbsp;
    <xsl:value-of select="$member/data[@alias='memberLastName']"/>.

    But I still get the old values. It seems as if the cached values have not been reloaded.

    Is it something know and is there any way to fix it?

     

    Thanks

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Sep 10, 2009 @ 00:56
    Aaron Powell
    0

    Which version of Umbraco are you using?

    If you're using v4 it's not recommended that you directly access the Member API, instead you should use the ASP.NET Membership module. See this wiki page: http://our.umbraco.org/wiki/how-tos/membership-providers

  • jdelagoutte 13 posts 26 karma points
    Sep 10, 2009 @ 09:00
    jdelagoutte
    0

    Unfortunately, I'm using Version3

  • jdelagoutte 13 posts 26 karma points
    Sep 10, 2009 @ 10:24
    jdelagoutte
    0

    I've solved it.

    After saving all the member properties, and before calling for refreshing the cache, I've called for regenerating the XML content of the member node.

    So, I have :

    currentMember.XmlGenerate(new System.Xml.XmlDocument());
    Member.RemoveMemberFromCache(Member.CurrentMemberId());
    Member.AddMemberToCache(Member.GetCurrentMember());

    and it is working now

Please Sign in or register to post replies

Write your reply to:

Draft