日期:2014-05-20  浏览次数:20401 次

关于Repeater绑定数据的问题,急急急!!!
在Page_Load中对Repeater1进行数据源绑定:
        Private   Sub   Page_Load(ByVal   sender   As   System.Object,   ByVal   e   As   System.EventArgs)   Handles   MyBase.Load
                Dim   cls_hrs_vacationdef   =   New   cls_hrs_vacationdef
                Repeater1.DataSource   =   cls_hrs_vacationdef.hrs_SelectAll( "2006-01-01 ",   "2006-12-31 ",   " ",   " ")
                Repeater1.DataBind()
        End   Sub
执行的时候提示错误:
Compilation   Error  
Description:   An   error   occurred   during   the   compilation   of   a   resource   required   to   service   this   request.   Please   review   the   following   specific   error   details   and   modify   your   source   code   appropriately.  

Compiler   Error   Message:   BC30516:   没有可访问的“Eval”接受此数目的参数,因此重载决策失败。

Source   Error:

 

Line   125: <ItemTemplate>
Line   126: <TR   bgColor= "#ffffff "   height= "20 ">
Line   127: <TD   class= "style1 "> <%#DataBinder.Eval( "name ")   %>
Line   128: </TD>
Line   129: <TD   class= "style1 ">
 
请问这是怎么回事?是否Eval()在Page_Load之前执行了?该如何解决,谢谢.

------解决方案--------------------
<%# DataBinder.Eval(Container.DataItem, "name ") %>
------解决方案--------------------
DataBinder.Eval() 最少也要两个参数哦。


DataBinder.Eval(Container.DataItem, "name ")