I have a linkbutton that I want to call a method in the code behind. The method takes a parameter of which I need to stick in a container.dataitem. I know the container.dataitem syntax is correct because I use it in other controls. What I don't know is how to user it a parameter for a method. Upon clicking on the button, the method should be called with the container.dataitem. The method is called 'AddFriend(string username)' Below is code. Thank you!
<asp:LinkButton ID="lbAddFriend" runat="server" OnClick='<%# "AddFriend(" +((System.Data.DataRowView)Container.DataItem)["UserName"]+ ")" %>' Text="AddFriend"></asp:LinkButton></td>