Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Container.DataItem problem


Message #1 by "Rich K" <rich@r...> on Thu, 31 Oct 2002 15:58:51 -0500
Could someone please help me with this problem.
I am trying to reference an Item from a dataset in a template column in the
following manner.
<ItemTemplate><%# Container.DataItem("Make") %></ItemTemplate>
This results in the following error:
'System.Web.UI.WebControls.DataGridItem.DataItem' denotes a 'property' where
a 'method' was expected

I can get it to work if I use the following syntax, but I have read that
referencing the item in the
following way uses late binding.
<% DataBinder.Eval(Container.DataItem, "Make") %>

Could someone please tell me why the first example doesn't work. I see this
format used in many books but I can't seem to get it to work for me. Thanks
for your help. Rich



  Return to Index