title: Pass object as CommandArguement in a Repeater Link Button
body: <p>I have a Repeater with a list of Customers. Against each customer there is a delete link button. As part of the linkbutton I want to pass the Customer object to the Command Arguement as follows (where Container.DataItem is the customer object):</p>
  
  <pre><code>&lt;asp:LinkButton  ID="lnkDelete" 
     OnClientClick="return confirmDelete();"  
     OnClick="Customer_OnDelete"  
     CommandArgument="&lt;%# Container.DataItem  %&gt;"  
     CommandName="Delete" 
     runat="server"&gt;&lt;/asp:LinkButton&gt;
  </code></pre>
  
  <p>When I do this:</p>
  
  <pre><code>    var button = (((LinkButton) sender));
  
      var customer=  button.CommandArgument;
  </code></pre>
  
  <p>button.CommandArguement is a string. I need all the object properties as we are using Nhibernate so everything needs to be set, the ID of the deleted record is not enough. I have seen examples online regarding passing a comma seperated list of values into the command arguement but want to avoid doing that. Is this possible?</p>
  
  <p>Any ideas?
  Thanks</p>