Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Sending value to Functions class in Transformation View modes: 
User avatar
Member
Member
usmaan.dad-controlf1.co - 6/17/2013 6:35:35 AM
   
Sending value to Functions class in Transformation
I am sending a value to a Functions class in App_Code but the value which is received by the method is null.

Transformation code:
<p class="<%= SMEFunctions.GetDocumentRatingCssClass(Eval("DocumentRatingValue"))%> />

Functions method:
public static string GetDocumentRatingCssClass(string documentRatingValue)
{
...
}

For some reason, documentRatingValue in the method signature is always Null. What am I doing wrong?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/17/2013 6:52:09 AM
   
RE:Sending value to Functions class in Transformation
Hi,

Could you please confirm that the custom functions is added and registered as per adding custom transformation functions documentation?

Best regards,
Juraj Ondrus

User avatar
Kentico Legend
Kentico Legend
Accepted solutionAccepted solution
Brenden Kehren - 6/17/2013 7:21:29 AM
   
RE:Sending value to Functions class in Transformation
You're using
<%=
vs
<%#
Since you are using this in the item transformation, you need to perform the Bind expression by using # vs =.

User avatar
Member
Member
usmaan.dad-controlf1.co - 6/17/2013 8:03:24 AM
   
RE:Sending value to Functions class in Transformation
Ah of course. Thank you very much FroggEye