asp.netgridviewcommandargument

Passing multiple argument through CommandArgument of Button in Asp.net


I have a gridview with multiple rows, each has a Update button and I need to pass 2 values when someone clicks on Update button. Aside from packing the arguments inside CommandArgument separated by commas (archaic and not elegant), how would I pass more than one argument?

<asp:LinkButton ID="UpdateButton" runat="server" CommandName="UpdateRow" CommandArgument="arg_value" Text="Update and Insert" OnCommand="CommandButton_Click" ></asp:LinkButton>

As a note, the values can't be retrieved from any controls on the page, so I am presently not seeking any design solutions.


Solution

  • After poking around it looks like Kelsey is correct.

    Just use a comma or something and split it when you want to consume it.