John B
John B

Reputation: 20380

How do you know to use Container.DataItem when data binding in ASP.NET? Is there a reference?

Is there a reference for data binding? I've seen a bunch of different ways to data bind things, but I've never found a reference. Is there one?

I know there are Bind and Eval, but when does Container.DataItem come into play? Are there other "hidden" objects and methods available? Or is Container.DataItem the object that is being used here?

Upvotes: 6

Views: 4084

Answers (1)

Jeff Sternal
Jeff Sternal

Reputation: 48593

when does Container.DataItem come into play?

From the first link below (paraphrasing slightly): "Container.DataItem is a runtime alias for the DataItem for this specific item in a bound list."

Are there other "hidden" objects and methods available?

Definitely the other DataBinder class members, plus TemplateControl, which houses Eval and provides methods to query bound Xml data.

I've seen a bunch of different ways to data bind things, but I've never found a reference. Is there one?

These are as close as you'll get:

Upvotes: 8

Related Questions