如何使用DataBinder.Eval从集合中检索当前对象? [英] How to retrieve current object from collections using DataBinder.Eval?

查看:145
本文介绍了如何使用DataBinder.Eval从集合中检索当前对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从集合中检索对象,并从托管网页中将对象和对象中的对象和对象分配给Web用户控制。

I am retrieving Objects from a collection and assigned objects and objects within objects to web user control from hosting web page.

<uc1:bookmarksList   runat ="server"   Link =<%#DataBinder.Eval(Container.DataItem, "OLinks")%>  

其中Olinks是集合中当前对象列表中的对象(例如User是集合中的当前对象)my问题如何在语法中从集合中检索当前对象

where Olinks is the objects within current objects list in collections(e.g User is current object in collection) my question how to retrieve current object from collections in syntax

DataBinder.Eval(Container.DataItem ..

DataBinder.Eval(Container.DataItem..

推荐答案

评估绑定方法已经获得集合的当前对象。你可能在数据绑定控件中使用Eval函数。控制循环你的集合,每个循环它获得集合的当前项目你应该在集合中的控件的一个属性eval。在你的例子看起来你绑定对象本身。

Eval or Bind methods already gets the current object of a collection. You're probably using Eval function in a databound control. Your databound control loops your collection and each loop it gets the current item of the collection. You should eval a property of your control in your collection. In your example it looks like you're binding the object itself.

这篇关于如何使用DataBinder.Eval从集合中检索当前对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆