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

不想你离开。 提交于 2019-12-21 05:06:36

问题


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?


回答1:


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:

  • What's the deal with Databinder.Eval and Container.DataItem? (Short and sweet)
  • ASP.NET data binding overview
  • Data-Binding Expressions Overview


来源:https://stackoverflow.com/questions/1876719/how-do-you-know-to-use-container-dataitem-when-data-binding-in-asp-net-is-there

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!