Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Container.DataItem("Title") throws error using C# not with vb?


Message #1 by "J House" <jesse@s...> on Sun, 11 Nov 2001 18:50:02
Just started playing with this dotNet stuff, came across a strange problem

I am binding a recordset to this datalist in the Page_Load event.

Does anyone know why this will throw an error when using C#?

It runs fine in vb.



If i remove the <%# Container.DataItem("Title") %> line then it works in 

C#.

<asp:DataList id="list" runat="server">

	<ItemTemplate>

	<b>Testing:</b><br>

	<%# DataBinder.Eval(Container.DataItem, "Title") %><br>

	<%# Container.DataItem("Title") %><br>

	</ItemTemplate>

</asp:DataList>



Any ideas?

  Return to Index