i'm trying to add a key and value to the hashtable and then put that hashtable in Session and this works fine but i'm getting error when i try to browse to different pages in gridview and here is the error message:
Item has already been added. Key in dictionary: '0' Key being added: '0' gridview
here is my code:
Hashtable ht = new Hashtable(); //declare in class level variable
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
............
........
ht.Add(e.Row.RowIndex, _sParameters); //error here
//Session.Add("alertmessages", ht);
Session["alerts"] = ht;
}
how should i deal with it?
thanks.