I have got a problem and i want to share with all of you. Sometimes there exists a scenario when you have to pass multiple command arguments on a button click.
The following code i used and it did the trick:
My Example contains a gridview containing a boundfield and a template field
<asp:GridView ID="gvEmail" runat="server" SkinID="DefaultGVWithoutPaging" >
<Columns>
<asp:BoundField HeaderText="Title" DataField="Title" />
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="ibtnEdit" SkinID="EditButtonImageSkin" CommandName="EditEmails" CommandArgument='<%#Container.DataItem("FileName") & ";" & Container.DataItem("Keywords") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
And on Server side use the split operator to split, i use the ‘;’ character as splitter
Protected Sub gvEmail_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvEmail.RowCommand
If e.CommandName = "EditEmails" Then
Dim paraArray() As String
paraArray = e.CommandArgument.ToString.Split(CChar(";"))
End If
End Sub
Hope to help someone.


