so now i'm passing the session value into master page and there i'm display the session value in the label
string Item_id = Convert.ToInt16((((Button)sender).CommandArgument)).ToString();
if (Session["mycart"] != null)
{
var productList = (List<string>)Session["mycart"];
productList.Add(Item_id);
Session["mycart"] = productList;
lblpno.Text= productList.Count.ToString();
ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Item added to cart');", true);
}
else
{
Session["mycart"] = new List<string> { Item_id};
ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Item added to cart');", true);
}