Creating controls at runtime

Discussion in 'ASP .Net' started by Bart Schelkens, Sep 29, 2004.

  1. Hi,

    i have a label on my webpage.
    I want to create some copys of this label at runtime, since i don't know how
    many labels i will be needing.

    How can i do this?

    Thx
    Bart Schelkens, Sep 29, 2004
    #1
    1. Advertising

  2. Bart Schelkens

    Lucas Tam Guest

    "Bart Schelkens" <> wrote in
    news::

    > i have a label on my webpage.
    > I want to create some copys of this label at runtime, since i don't
    > know how many labels i will be needing.
    >
    > How can i do this?




    Dim newLabel as Label()

    For i = 0 as integer to NumLabel
    newLabel = new Label()
    PlaceHolder.controls.add(newLabel)
    Next

    PlaceHolder is a placeholder on your page

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Sep 29, 2004
    #2
    1. Advertising

  3. And if I was to buttons this way, how would I write the onclick-event of
    those buttons ?

    "Lucas Tam" <> wrote in message
    news:Xns9573372651FEFnntprogerscom@140.99.99.130...
    > "Bart Schelkens" <> wrote in
    > news::
    >
    > > i have a label on my webpage.
    > > I want to create some copys of this label at runtime, since i don't
    > > know how many labels i will be needing.
    > >
    > > How can i do this?

    >
    >
    >
    > Dim newLabel as Label()
    >
    > For i = 0 as integer to NumLabel
    > newLabel = new Label()
    > PlaceHolder.controls.add(newLabel)
    > Next
    >
    > PlaceHolder is a placeholder on your page
    >
    > --
    > Lucas Tam ()
    > Please delete "REMOVE" from the e-mail address when replying.
    > http://members.ebay.com/aboutme/coolspot18/
    Bart Schelkens, Sep 29, 2004
    #3
  4. Bart Schelkens

    Lucas Tam Guest

    Lucas Tam, Sep 29, 2004
    #4
    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. Varangian
    Replies:
    7
    Views:
    561
    Varangian
    Apr 27, 2006
  2. Tarscher
    Replies:
    9
    Views:
    396
    Russell
    Feb 13, 2007
  3. Replies:
    2
    Views:
    288
    Scott McPhillips [MVP]
    Nov 7, 2005
  4. geronimo

    Creating controls at runtime

    geronimo, Jul 22, 2003, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    186
    geronimo
    Jul 22, 2003
  5. Mike Towle

    Dynamically Creating Controls at Runtime

    Mike Towle, Apr 14, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    165
    Alvin Bruney [MVP]
    Apr 16, 2004
Loading...

Share This Page