aspx_professional thread: Container.DataItem -- DataItem not defined in UserControl Class
Using this in a DataList repeater user control. Use am trying to build a
dynamic menu based off a Sql Server 2000 database but when I compile and
run i get the middle finger about how the DataItem definition doesn't
exist in the System.Web.UI.UserControl class ??? How in the hell does
everyone else use it?
code snippet for the control
<asp:DataList id=List runat=server >
<ItemTemplate>
<asp:HyperLink id=hyper1 class=UnSelected Text='<%# DataBinder.Eval
Container.DataItem, "name")%>'
NavigateUrl='<%# "products.aspx?departmentID=" +
DataBinder.Eval(Container.DataItem, "departmentid"+
"&selection=" + Container.ItemIndex %>' runat="server" />
</ItemTemplate>
<SelectedItemTemplate>
<asp:HyperLink id=hyper1 class=Selected Text='<%# DataBinder.Eval
Container.DataItem, "name")%>'
NavigateUrl='<%# "products.aspx?departmentID=" +
DataBinder.Eval(Container.DataItem, "departmentid"+
"&selection=" + Container.ItemIndex %>' runat="server" />
</SelectedItemTemplate>
</asp:DataList>
TIA
Morgan