Hi,
Please modify your Button click Code like below:
protected void Button1_Click(object sender, EventArgs e)
{
count++;
List<a> list1 = new List<a>();
a class1 = new a();
class1.No = count.ToString();
class1.Fname = txtFname.Text;
class1.Lname = txtLname.Text;
list1.Add(class1);
List<a> tempList = new List<a>();
tempList = (List<a>)Session["list1"];
list1.AddRange(tempList);
Session["list1"] = list1.ToString();
GridView1.DataSource = (DataTable)Session["list1"];
GridView1.DataBind();
txtFname.Text = "";
txtLname.Text = "";
}
I used a new temp List to store value of session and then add it to actual List