[RESOLVED] Creating a list on the page

I can add a user control dynamically but what is the best way to be able to create a list of objects on the page for retrieval later, let's say I'm adding 3 items of something by selecting from a dropdown and clicking on a button.  Each time I try the past objects are lost and only the new item is added?

are you using IspostBack on page_load event?

it might be that u r clearing list on page_load without checking IsPostBack

posting codebehind code would help...

I don't have the code to post at hand, I was merely asking others for their best method for doing this kind of thing.  What would you recommend?


Because the asp.net do't keep the created dynamicly control staate.

So you should create them every time when the page post to server.

Another way is that you store them into cache or session.

But it also has the drawbacks, it will lay more memory stress over the asp.net server.

In the end I have used knockout.js to create them client-side and used ajax to store them.

thoughts on "[RESOLVED] Creating a list on the page"

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>