Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Creating controls at runtime

Reply
Thread Tools

Creating controls at runtime

 
 
Bart Schelkens
Guest
Posts: n/a
 
      09-29-2004
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


 
Reply With Quote
 
 
 
 
Lucas Tam
Guest
Posts: n/a
 
      09-29-2004
"Bart Schelkens" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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 ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
 
 
 
Bart Schelkens
Guest
Posts: n/a
 
      09-29-2004
And if I was to buttons this way, how would I write the onclick-event of
those buttons ?

"Lucas Tam" <(E-Mail Removed)> wrote in message
news:Xns9573372651FEFnntprogerscom@140.99.99.130.. .
> "Bart Schelkens" <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):
>
> > 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 ((E-Mail Removed))
> Please delete "REMOVE" from the e-mail address when replying.
> http://members.ebay.com/aboutme/coolspot18/



 
Reply With Quote
 
Lucas Tam
Guest
Posts: n/a
 
      09-29-2004
"Bart Schelkens" <(E-Mail Removed)> wrote in news:#dkmvJipEHA.3424
@TK2MSFTNGP11.phx.gbl:

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


Take a look at AddHandler and RemoveHandler
http://msdn.microsoft.com/library/de...l=/library/en-
us/vblr7/html/vastmAddHandlerStatement.asp

--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
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
creating dynamic controls out of static controls Tarscher ASP .Net 9 02-13-2007 02:33 PM
Creating controls at runtime or designtime Varangian ASP .Net 7 04-27-2006 07:33 AM
Creating a scrollable window for runtime created controls dfreas@gmail.com C++ 2 11-07-2005 02:41 PM
Dynamically Creating Controls at Runtime Mike Towle ASP .Net Web Controls 1 04-16-2004 05:01 PM
Creating controls at runtime geronimo ASP .Net Building Controls 3 07-22-2003 06:53 PM



Advertisments