How to pass multiple values through command argument in Asp.net?


We can pass multiple values with comma separated in Asp.net gridview CommandArgument as

<asp:LinkButton ID="lnkButton" runat="server" CommandName="View Details" CommandArgument='<%#Eval("iCallID")+","+ Eval("iPortfolioId")%>'>View</asp:LinkButton>


We need to Split Command Arguments value to get separate values.

String[] CommandArg_Values= e.CommandArgument.ToString().Split(new char[] { ',' });
Int32 iCallID = Convert.ToInt32(CommandArg_Values[0]);
Int32 iPorfolioId = Convert.ToInt32(CommandArg_Values[1]);