Copied to clipboard

Flag this post as spam?

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


  • stc 72 posts 101 karma points
    Apr 14, 2010 @ 16:12
    stc
    0

    Unwanted caching XSLT macro results...

    Here's a very simple XSLT which I made into a macro:

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:variable name="currentMember" select="umbraco.library:GetCurrentMember()"/>

    <xsl:template match="/">
    <xsl:choose>
    <xsl:when test="umbraco.library:IsLoggedOn() = true()">
    <xsl:value-of select="$currentMember/data [@alias = 'frame']" />
    </xsl:when>
    <xsl:otherwise>default</xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    </xsl:stylesheet>

    It's simply called inside the header of each page so it returns logged in member's "frame" property each time it's called.

    However, if I log into umbraco backend and change the property manually (saving member afterwards) it won't reflect upon the next refresh of the page...my guess is the of the results of the macro or even the whole pages themselves get cached...any way to aviod caching?

  • stc 72 posts 101 karma points
    Apr 14, 2010 @ 16:24
    stc
    0

    solved it.

    Only if someone could help me understand why, I'd be much grateful...

    Followin this...or in other words by adding these two lines in front of my loginview control's login button click event which used AddMemberToCache:

    currentMember.XmlGenerate(new System.Xml.XmlDocument());
    Member.RemoveMemberFromCache(Member.CurrentMemberId());
  • stc 72 posts 101 karma points
    Apr 15, 2010 @ 08:20
    stc
    0

    Seems I spoke too soon...

    I've now got a MAJOR issue. Though most of it probably comes from my code, since I just now tested the custom made login control (made from loginview asp.net control) on another umbraco website I'm hosting on the same server and it won't work there either. User/pass just won't log me in.

    First off, the Member.RemoveMemberFromCache(Member.CurrentMemberId()); line breaks everything (though it worked extremely well initially)...object not set reference error...Member.GetMemberId() returns null.

    My guess is I'm doing it all wrong when working with members...but the documentation is a bit confusing...I've seen pages that for v4 (I'm using 4.0.3) you shouldn't use Umbraco API at all for membership, but how do I login members then please? AddMemberToCache is or it is not an option?!

    Also, it worked perfectly before I managed to rename it to an existing .NET umbraco macro control's name, so I'm guessing there might also be some cache issues there, but since I used it on another website maybe not since I'm guessing two different umbraco websites (even though on the same Win2k8r2 server) don't share cache, or do they? How to reset the cache? Delete Temporary ASP.NET files or some xmls?

    Please help, thanks in advance.

Please Sign in or register to post replies

Write your reply to:

Draft