Calling Memeber methods from C# embedded in XSLT Options
met67
Posted: Thursday, October 04, 2007 11:02:25 PM

Rank: Devotee

Joined: 9/4/2007
Posts: 36
Location: Rome
Hi,

I am trying to call methods of the Member class from within a C# function embedded in an XSLT file,
but I can't get it working.
I have read from Microsoft docs http://msdn2.microsoft.com/en-us/library/533texsx(vs.71).aspx
that I have to use fully qualified class names, but it still fails.

Does anybody succeded in this?
I would prefer not to use a dll to extend umbraco...

TIA,
Marco Lusini


Code:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:pcm="urn:pcm-it:xslt"
    exclude-result-prefixes="msxml umbraco.library">

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

<xsl:param name="currentPage"/>

<xsl:template match="/">

<!-- start writing XSLT -->

<xsl:value-of select="pcm:Test()"/>

</xsl:template>

<msxsl:script language="C#" implements-prefix="pcm">
  <![CDATA[

    public string Test()
    {
       if ( umbraco.cms.businesslogic.member.Member.IsLoggedOn() )
         return "Cips";
       else
         return "Ciaps";
    }

  ]]>
  </msxsl:script>
</xsl:stylesheet>
Users browsing this topic
Guest


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.