views:

15

answers:

1

i got this inside a button inside a datalist

CommandName="<%# Container.ItemIndex %>"

when i click the button, i'm expecting commandname to = 0, then 1, then 2, etc, as the datalist progresses, and i'm using that value in the button click's c#

but i'm getting this error, i'm pretty sure i'm using this exact setup on another page and i have no problems, any idea what's going on?

Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'System.Web.UI.Control' does not contain a definition for 'ItemIndex'

A: 

figured out this will work for some reason, posting for future searchers

CommandName='<%# DataBinder.Eval(Container,"ItemIndex")  %>'
korben