Andrey Markeev on SharePoint

A bit of SharePoint XSLT magic

September 13, 2011

Stumbled upon another example of SharePoint magic in XSLT today.

Was trying to insert a link to a themable css into my XSLT. Written following code:

<xsl:template match="/">
  <SharePoint:CssRegistration runat="server" Name="/Style Library/Themable/Test.css" EnableCssTheming="True" />
</xsl:template>

And got following error:

A very vague description, isn't it?

Type 'Microsoft.SharePoint.WebControls.CssRegistration' does not have a public property named 'xmlns:SharePoint'.

After several tries, ended up with following working code:

<xsl:template match="/">
  <span>
    <SharePoint:CssRegistration runat="server" Name="/Style Library/Themable/Test.css" EnableCssTheming="True" />
  </span>
</xsl:template>

Find the difference! :) It's the magic, definitely...

Like it?

About me

I'm SharePoint MVP, published author, frequent speaker, opensource projects creator and online expert.

I'm one of the top 10 experts on SharePoint StackExchange:

profile for omlin at SharePoint, Q&A for SharePoint enthusiasts

You can learn more about me on LinkedIn and Facebook.

Want to follow?

Subscribe to RSS!

Twitter

Blog archive