How to keep data stored in generic List<T> available during all processes at the same page.
I need to Save selected items in generic List<T> . and keep it until selecting all items needed. Then by pressing the second button "show search results" .
My problem was when I press the second pagination page number, I lose the selected items in previous page "the List<T> is reset".
Could anyone help me please to keep these selected items accumulated to the List<T> until I finish all items I need to select from all available pages.
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
leverage ajax and store selected items in javascript object between page changes
save the (best, but a pain)
create a viewstate to preserve data between postbacks (good and normal for webforms)
save data to a cookie between postbacks (worst, and most painful)
hope that helps, if i cared i'd go with option one, if this thing just has to work i'd go the view state way
https://msdn.microsoft.com/en-us/library/ms972976.aspx