Author: bbc_sh | Posted on: 8/24/2008 7:59:44 AM | Views : 455

 I wrote this code for getting the id of every row in gridview when a
button click.I don't know what code should i write for loop(because
maybe a user click on several button to order a product).I want to when
a button click the Id of it store in a list.and then i want to store list in session.

 
protected void grid_product(object sender, GridViewCommandEventArgs e)
{
string currentcommand = e.CommandName;
int currentrowindex = Int32.Parse(e.CommandArgument);
string productid = GridView1.DataKeys[currentrowindex].Value;
}   
...

Go to the complete details ...