I have a listview with paging. Every paging has 10 rows with with a username, an email and a checkbox.
I need to be able to check a couple of checkboxes, in different “pagings”, press a button and send an email every to ever user that has been checked.
Trouble is I don’t really know how to remember the selected checkboxes between each paging-press.
Are you with me?
Deos anyone have a similar solution or a few tips on how to do this?
I’d prefer to solv this without jQuery, but ordinare javascript or a C# solution works fine.
Thanks in advance!
Try this
http://forums.asp.net/t/1619741.aspx?Remember+checkboxes+in+ListView
you could maintain a List<> of selections (say ID to each record, unique value) and would have to persist that list in the ViewState. update the list on a page change. bind the checkbox checked property through a code-behind function that checks whether the id is in the list.
here’s a sample:
you need the routines Selected (that returns a boolean) and UpdateSelections (which maintains), the rest of the code simply gets the ListView to demonstrate the sample along with dummy data.