ASPX templates
Version 5.x > ASPX templates > Eval() Outside of <%# %> Block View modes: 
User avatar
Member
Member
eric.rovtar-hudsonchapel - 8/9/2010 5:41:19 PM
   
Eval() Outside of <%# %> Block
Is there a way to use Eval() within a Transformation but inside a standard code block (<% %>)?

When I try, I get the following error:
[CMSDataProperties.LoadTransformation]: http://server/CMSTransformations/93c6a6ed-d9be-4ae9-9450-fbd53319f410/cms/event/default.ascx(6): error CS1502: The best overloaded method match for 'System.Web.UI.AttributeCollection.Add(string, string)' has some invalid arguments


Thanks!

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/13/2010 7:58:05 AM
   
RE:Eval() Outside of <%# %> Block
Hello,


You can use custom transformation functions - you may evaluate the Eval functions and send them as arguments to the code of custom transformation function. There you can use the standard ASP.NET code and the actual values of Eval.

Or you can create a custom control and use the eval function for properties. We use this approach in transformation for E-commerce where we register ShoppingCartItemSelector.


Best regards,
Helena Grulichova