Erwin's Blog

Developing with .NET

DataBinder Eval and Indexed properties

As you probably know you can “Eval” an array property like below:

<%# Eval("MyArray[0].Title") %>

But what if your data object has indexed property? how do “Eval” that?
Well it’s easier then you think it is:

<%# Eval("[0]") %>

And if your indexed property is based on for example a NameValueCollection you can “Eval” it like this:

<%# Eval("[key]") %>

As you see it’s very easy to “Eval” this kind of properties in you web application.

Posted: Mar 24 2010, 10:15 AM by erwin21 | with 2 comment(s)
Filed under: , ,

Comments

No Comments