ASP 2: item from arraylist vanished ?!

  • Thread starter Thread starter G. Völkl
  • Start date Start date
G

G. Völkl

Hello,

I have a real simple asp.net 2.0 page::

1 button - 1 textfield

If you press the button, the value of the textfield will be added to the
arraylist:

private x as new arraylist

protected sub button_click( ....)
x.add(txtFeld.text)
end sub

If you press the button again the item of the arraylist is vanished. Whats
worng?

Thanks

Best regards
Gerhard
 
You aren't persisting your arraylist from page visits to page visits. every
time you are recreating a new arraylist and starting from scratch. Store it
somewhere, like the viewstate or the session, and retrieve it from said
storage when Page.IsPostback

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top