Hunt

Showing posts with label Pass More Than One Command Argument in gridview. Show all posts
Showing posts with label Pass More Than One Command Argument in gridview. Show all posts

Thursday, June 9, 2011

Pass More than One Command Argument in Gridview

inside grid
-----------------------
html source
---------------
< asp:LinkButton runat="server" ID="lnkZipCount" Text='< %#Eval("ZipCount") %>' CommandArgument='< %#Eval("CityID") + ";" +Eval("Sname")%>' OnClick="lnkZipCount_Click" >< /asp:LinkButton >
-------------------------

c#
---------------

LinkButton lnkPortal = (LinkButton)sender;

string info = lnkPortal.CommandArgument;

string[] arg=new string[2];

char[] splitter= {';'};

arg = info.Split(splitter);

Session["FunctionalGroupId"] = arg[0];

Session["FunctionalGroupName"] = arg[1];

Response.Redirect("PortalGroup.aspx");



-----------------------------------------------

URL:

http://www.dotnetspider.com/resources/32507-Passing-multiple-values-commandline-arguments.aspx

http://www.aspsnippets.com/Articles/ASP.Net-GridView---Get-Row-Index-on-RowCommand-and-Click-events.aspx