In Gridview, I have only one Row Command Event.
protected void gvProducts_RowCommand(object sender, GridViewCommandEventArgs e)
{
string ProductName = null;
string ProductID = null;
string EncrptyProdID = null;
string ProdImage = null;
//int index = Convert.ToInt32(e.CommandArgument);
if (e.CommandName == "FB")
{
string[] arguments = e.CommandArgument.ToString().Split('|');
ProductID = arguments[0].ToString();
EncrptyProdID = stringToBase64String(ProductID);
ProductName = arguments[1].ToString();
ProdImage = arguments[2].ToString();
HttpContext.Current.Response.Write("<SCRIPT LANGUAGE='JavaScript'>window.open('http://www.facebook.com/share.php?u=http://www.mysite.com/Product/" + EncrptyProdID + "','_blank', 'location=yes,width=700,height=400');</SCRIPT>");
}
else if (e.CommandName == "twit")
{
string[] arguments = e.CommandArgument.ToString().Split('|');
ProductID = arguments[0].ToString();
EncrptyProdID = stringToBase64String(ProductID);
ProductName = arguments[1].ToString();
ProdImage = arguments[2].ToString();
HttpContext.Current.Response.Write("<SCRIPT LANGUAGE='JavaScript'>window.open('https://twitter.com/share?text=" + ProductName + " @ mysite.com&url=http://www.mysite.com/Product/" + EncrptyProdID + "','_blank', 'location=yes,width=700,height=400');</SCRIPT>");
}
else if (e.CommandName == "Google")
{
string[] arguments = e.CommandArgument.ToString().Split('|');
ProductID = arguments[0].ToString();
EncrptyProdID = stringToBase64String(ProductID);
ProductName = arguments[1].ToString();
ProdImage = arguments[2].ToString();
HttpContext.Current.Response.Write("<SCRIPT LANGUAGE='JavaScript'>window.open('https://plusone.google.com/_/+1/confirm?hl=en&url=http://www.mysite.com/Product/" + EncrptyProdID + "','_blank', 'location=yes,width=700,height=400');</SCRIPT>");
}
}