views:

59

answers:

1

Hi, I have a asp gridview which shows some properties and links to another page. When the user is seeing the gridview I would like to highlite the whole row (not just the link) for those rows where a user has clicked the link before.

I was thinking about onclick to save the id of the row in a comma seperated cookie, and the OnItemDataBound check if the item is in the cookie list.

My only concern is the performance, because lets say the user has visited 30 links, then on each item to render it has too look through all those 30 items to see if it contains the id, which will only get slower the more links a user has clicked.

Is there a more performance efficient way to do this?

Also I need to tell that the user won't be logged in, so I can't put the value into a database.

A: 

You could load the IDs into a generic list, sort the list and do a binarysearch. Also, once an ID is found, you can remove it from the list so as more IDs are found, fewer need to be searched.

Steve