title: repeater item command in asp.net
body: <p>i am working with asp.net and i have a repeater.I want to take a respond from one of the items, which has been displayed by repeater.Here is my code:</p>
  
  <pre><code>&lt;asp:Repeater ID="Repeatercart" runat="server" OnItemCommand ="RepeaterDeleteitemcommand" &gt;
  &lt;ItemTemplate&gt;                     
      &lt;table&gt; 
      &lt;tr&gt;
          &lt;td&gt;&lt;img id="Image1" src="PerfumeImages/&lt;%#Eval("ProductImage") %&gt;" width="90" /&gt;&lt;/td&gt;
      &lt;/tr&gt;                               
      &lt;tr&gt;
          &lt;td&gt;&lt;%#Eval("ProductName") %&gt; x&lt;%#Eval("Quantity") %&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; &lt;%#Eval("ProductGender") %&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt; &lt;%#Eval("ProductSize") %&gt; ml&lt;/td&gt;
      &lt;/tr&gt;                               
      &lt;tr&gt;
          &lt;td&gt;&lt;a class="buy-btn"&gt;&lt;asp:Button ID="Button1" CommandName="Click" Text="Remove from cart" runat="server" CommandArgument='&lt;%# Eval("ProductId") %&gt;' /&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;            
  &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;   
  </code></pre>
  
  <p>and this is my codebehind:</p>
  
  <pre><code>protected void RepeaterDeleteitemcommand(object source, RepeaterCommandEventArgs e)
  {
      switch (e.CommandName)
      {
          case "Click":
                 Label1.Text = "ok !";
                 break;
      }
  }  
  </code></pre>
  
  <p>When i run this code, i get an error like: Invalid postback or callback argument. Event validation is enabled using  in configuration or &lt;%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.Thanks for the help</p>