Category

ASP.Net

Category

When you want to use a fieldcontrol like a Text, Link or Image control in a ListView you need to specify a datasource. By not specifying a datasource Sitecore looks at the current item. Which in a ListView is not the right one. So you need so set the datasource in code-behind or use an Eval expression in code-before.

When you want you use the code-behind option you need to raise an eventhandler which triggers the ItemDataBound handler.In that event you want to get the values of the current item. So you need to cast the ListViewDataItem to an Sitecore item.