Beginnermediate ASP.NET

ASP.NET for newbs to intermediate

Eval in DataList, DataGrid, and Repeater

Yesterday in the "Coolness of SubSonic" post I had a bit of asp.net markup (as I call it) that would display data in a data list from the data source.  It specifically used.

<%# Eval("Name") %>

For a long time I have wondered how that worked I could never seem to figure it out until yesterday.  Basically, you have an object that you bind to the data control like a datalist.  In the case yesterday it was a Product class Object:


Well in the asp.net markup that we have below:

 

Notice in the Eval part it uses Name also notice from the product class above there is a name property.  What ever property the object has you can use that in the Eval and it will display the data in there that comes from our collection of objects.  In this case the Name property of our collection of Product Objects.

I know this wasn't a "cool" post, but it is something I was excited to finally understand so I thought I would post on it to help others understand hopefully.

Comments

ahinger said:

hey dude, it was really a cool post..good work frnd.

# July 11, 2008 2:09 AM

cheap herve leger dress said:

I am so thrilled for having found your site.

# July 20, 2011 10:26 PM

moncler down jackets said:

Great blog. There's a lots good data in this blog, though I would like tell you something.

# August 9, 2011 11:31 PM

Monster beats studio said:

You're probably sick of hearing it, but you've got a really well written blog. Keep up the the great work.

# August 30, 2011 10:19 PM

Louis Vuitton Clothing said:

Thats an newsworthy displace. It was worth visiting your blog. Desire to communicate again.

# September 2, 2011 8:14 AM

baseball caps said:

Thanks for taking this opportunity to converse about  this, I feel strongly  about this and I enjoy learning about this subject.

# September 6, 2011 3:59 AM

designer bags said:

The theme is really attractive. Congratulations to the author of the blog!

# September 17, 2011 5:07 AM

myfring@hotmail.fr said:

You could certainly see your enthusiasm in the work you write. The arena hopes for even more passionate writers such as you who are not afraid to mention how they believe. At all times follow your heart.

# April 18, 2013 3:33 AM