title: asp.net listview Container.DataItemIndex
body: <p>I am trying to pass commandarguments like </p>
  
  <pre><code>&lt;asp:Button ID="btnSave" runat="server" Text="Save" CommandName='&lt;%# Eval("Section_Name")%&gt;' CommandArgument='&lt;%# Container.DataItemIndex %&gt;' /&gt;
  </code></pre>
  
  <p>but I get this error: </p>
  
  <p>'System.Web.UI.Control' does not contain a definition for 'DataItemIndex' and no extension method 'DataItemIndex' accepting a first argument of type 'System.Web.UI.Control' could be found (are you missing a using directive or an assembly reference?)</p>
  
  <p>What is the correct method to pass the commandarguments? 
  This button is inside and updatepanel in the itemtemplate of a listview. </p>
  
  <p>Thanks, Ali</p>