C
cally_kalpana
Guest
Hi all
I am stuck again, but now with retaining the values during page postback. You see, everytime I click on a button or any control that has event handler tied to it, the page postbacks and the list gets initialized everytime resulting in the data that was earlier added to the list gets emptied.
I have done some reading and realise that this is because of the page lifecycle and there are few ways to overcome it, we can either declare the list as static, use view state or session.
But I read that view state would cause an issue when the data becomes large. What are the pros and cons of each technique?
What's the best way forward, I declared the list at the class and not in any of the method. This post was earlier linked to
How to call a list created in an event handler? Best practices in creating list and storing them in the code ?
Continue reading...
I am stuck again, but now with retaining the values during page postback. You see, everytime I click on a button or any control that has event handler tied to it, the page postbacks and the list gets initialized everytime resulting in the data that was earlier added to the list gets emptied.
I have done some reading and realise that this is because of the page lifecycle and there are few ways to overcome it, we can either declare the list as static, use view state or session.
But I read that view state would cause an issue when the data becomes large. What are the pros and cons of each technique?
What's the best way forward, I declared the list at the class and not in any of the method. This post was earlier linked to
How to call a list created in an event handler? Best practices in creating list and storing them in the code ?
Continue reading...