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. Advertising

  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. Advertising

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. Ali
    Replies:
    2
    Views:
    368
    Prateeksha Web Services
    Dec 23, 2003
  2. Marvel
    Replies:
    16
    Views:
    607
    Marvel
    Mar 24, 2006
  3. netnatter

    Server Explorer vanished

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

    GtkGlArea vanished?

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

    wtf? gem command vanished

    Giles Bowkett, Oct 12, 2007, in forum: Ruby
    Replies:
    15
    Views:
    176
    ara.t.howard
    Oct 13, 2007
Loading...

Share This Page