03.11Repeater DataBinder.Eval “Conditional” Expression
In VB.NET there is a useful IIF statement that let’s you do inline evaluations of expressions via conditional coding… but in C#, let’s just say it is “done differently”… a really useful difference to bare in mind is that those expressions CAN be evaluating using Ternary operators, such as:
< %# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, “DateAdded”)) >= DateTime.Now.AddDays(-30) ? “Add something here” : “Else Add somethign here.”% >
Hope that helps someone other then myself…

Leave a Reply