Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Has any ever tried calling an embedded C# function from within content query XSL?

Contrived example:

HTML
<msxsl:script language="C#" implements-prefix="user">
<![CDATA[
public string yoGabba(string aThing){
  return aThing + " gabba";
}
]]>
</msxsl:script>

<xsl:template name="EmbedExample_FAIL" match="Row[@Style='EmbedExample_FAIL']" mode="itemstyle">
  <xsl:value-of select="user:yoGabba(@Title)"/>
</xsl:template>


The exception in the SharePoint log is:

System.Xml.Xsl.XslTransformException: Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it.

Given that I only have "control" of the XSL and not the underlying code for the web part, am I simply out of luck or is there some way?
Posted
Updated 30-Apr-14 7:23am
v2

1 solution

You cannot get past the EnableScript property. For this to work, you'll need to enable it. It is a security feature and not one you can get around.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900