CS1061: ‘System.Web.UI.Control’ does not contain a definition for ‘DataItem’ and no extension method ‘DataItem’ accepting a first argument of type ‘System.Web.UI.Control’ could be found

8 07 2008

If you are using an update panel inside of a repeater’s ItemTemplate you must either use Eval() instead of accessing the data item directly, or you must explicitly cast the data item:

((System.Web.UI.WebControls.RepeaterItem)(Container)).DataItem

That is all :)


Actions

Information

2 responses

15 10 2008
Mayank

Thanks a ton dude, it was driving me nuts.

7 11 2008
Jerry Nixon

Perfect. Thanks.

Leave a comment