protected void ItemCommand(object sender, DataGridCommandEventArgs e) { // *** Button command Names contain Sku value if set if (e.CommandName != null && e.CommandName != "" && e.CommandName != "Page") { // *** If we clicked on one of the items to buy - redirect to the item page string sku = e.CommandName; string qty = ((TextBox) e.Item.FindControl("qty")).Text; if (sku != null && sku!="") { Server.Transfer("Item.aspx?sku=" + sku.Trim() + "&qty=" + qty + "&Action=Add"); //Response.Redirect("Item.aspx?sku=" + sku.Trim() + "&qty=" + qty + "&Action=Add"); } } }Note that this event fires for any clicks you make on buttons, page links etc. so it's important that you filter out all the stuff you're not interested in. In the above example I filter out Page requests and nulls before picking up the values.