Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP 2: item from arraylist vanished ?!

Reply
Thread Tools

ASP 2: item from arraylist vanished ?!

 
 
G. Völkl
Guest
Posts: n/a
 
      11-18-2005
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


 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      11-18-2005
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

--
MY ASP.Net tutorials
http://www.openmymind.net/


"G. Völkl" <(E-Mail Removed)> wrote in message
news:dll59b$979$01$(E-Mail Removed)-online.com...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear Arraylist vs new ArrayList Philipp Java 6 05-28-2008 09:07 PM
Does the clone() method of ArrayList<> make a copy of the objects in the ArrayList? xz Java 16 08-04-2007 10:33 PM
a class inherited from ArrayList, is saved to ViewState, why the type of the object read from ViewSate is not the class, but the parent, ArrayList leal ting ASP .Net 1 02-10-2004 07:45 PM
writeObject with ArrayList of ArrayList? Kaidi Java 4 01-03-2004 08:16 PM
Iterate through ArrayList using an another ArrayList Saravanan Rathinavelu ASP .Net 3 08-19-2003 07:03 AM



Advertisments