ASP 2: item from arraylist vanished ?!

Discussion in 'ASP .Net' started by G. Völkl, Nov 18, 2005.

  1. G. Völkl

    G. Völkl Guest

    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
     
    G. Völkl, Nov 18, 2005
    #1
    1. Advertisements

  2. G. Völkl

    Karl Seguin Guest

    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" <> wrote in message
    news:dll59b$979$01$-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
    >
    >
     
    Karl Seguin, Nov 18, 2005
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saravanan Rathinavelu

    Iterate through ArrayList using an another ArrayList

    Saravanan Rathinavelu, Aug 16, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,059
    Natty Gur
    Aug 19, 2003
  2. Ali
    Replies:
    2
    Views:
    511
    Prateeksha Web Services
    Dec 23, 2003
  3. Kaidi
    Replies:
    4
    Views:
    3,080
    Kaidi
    Jan 3, 2004
  4. Marvel
    Replies:
    16
    Views:
    792
    Marvel
    Mar 24, 2006
  5. netnatter

    Server Explorer vanished

    netnatter, Jun 23, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    356
    Cowboy \(Gregory A. Beamer\)
    Jun 23, 2008
  6. Massimiliano Mirra - bard

    GtkGlArea vanished?

    Massimiliano Mirra - bard, Jul 18, 2003, in forum: Ruby
    Replies:
    0
    Views:
    178
    Massimiliano Mirra - bard
    Jul 18, 2003
  7. Giles Bowkett

    wtf? gem command vanished

    Giles Bowkett, Oct 12, 2007, in forum: Ruby
    Replies:
    15
    Views:
    292
    ara.t.howard
    Oct 13, 2007
  8. Dean Hannotte

    @ARGV vanished!

    Dean Hannotte, Apr 29, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    187
    John Bokma
    May 5, 2005
Loading...