Eval: Sometimes I like spagheti code
I just discovered some interesting features of the construct . Eval function uses reflection to evaluate a property of a bound object. I have two classes Product and Category and I want to display the available products in a page, by using a data bound control. public class Product { public int ID; public string Name; public int Stock; public DateTime Date; public Category Category; } public class Category { public string Name; public DateTime Date; } In a data template ( ItemTemplate for sample ) I can use the Eval function like: 1. very simple evaluation without using formats - will output the name - will output the stock ( ..and so on ) 2. using a format - for sample: 2009 Apr 06 - will output "10 items" if the stock is 10 3. Combining two or more properties: notice that the operators "+" are in the construction and the expression is not a concatenation between different constructs 4. Can use more dots! 5. Can use casting 6. What...