I
ibiza
Hi all,
I have a simple scenario where I simply bien a repeater to a
datasource. Here's my repeater definition :
<asp:Repeater id="rTitles" runat="server" EnableViewState="false"
OnItemDataBound="Bind">
<headertemplate>
<ul>
</headertemplate>
<itemtemplate>
<li>
<%#Eval("str1")%>
</li>
</itemtemplate>
<footertemplate>
</ul>
</footertemplate>
</asp:Repeater>
So each time an item is bound, "Bind" is called, which looks like that
(just for testing) :
Protected Sub Bind(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)
Dim drv As DataRowView = r.DataSource = e.Item.DataItem
End Sub
Well, "e.Item.DataItem" is always null (nothing) and that's my question
: WHY? Because when I put the single line in Bind in comment, my
repeater has all its data displayed, as if each row has a correct
dataitem. Why is my dataitem always null only in the ItemDataBound
method?
Thank you very much,
ibiza
I have a simple scenario where I simply bien a repeater to a
datasource. Here's my repeater definition :
<asp:Repeater id="rTitles" runat="server" EnableViewState="false"
OnItemDataBound="Bind">
<headertemplate>
<ul>
</headertemplate>
<itemtemplate>
<li>
<%#Eval("str1")%>
</li>
</itemtemplate>
<footertemplate>
</ul>
</footertemplate>
</asp:Repeater>
So each time an item is bound, "Bind" is called, which looks like that
(just for testing) :
Protected Sub Bind(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)
Dim drv As DataRowView = r.DataSource = e.Item.DataItem
End Sub
Well, "e.Item.DataItem" is always null (nothing) and that's my question
: WHY? Because when I put the single line in Bind in comment, my
repeater has all its data displayed, as if each row has a correct
dataitem. Why is my dataitem always null only in the ItemDataBound
method?
Thank you very much,
ibiza