473,770 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating controls at runtime

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
Nov 18 '05 #1
3 1587
"Bart Schelkens" <BS********@hot mail.com> wrote in
news:Ox******** ******@TK2MSFTN GP11.phx.gbl:
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.con trols.add(newLa bel)
Next

PlaceHolder is a placeholder on your page

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2
And if I was to buttons this way, how would I write the onclick-event of
those buttons ?

"Lucas Tam" <RE********@rog ers.com> wrote in message
news:Xn******** *************** ****@140.99.99. 130...
"Bart Schelkens" <BS********@hot mail.com> wrote in
news:Ox******** ******@TK2MSFTN GP11.phx.gbl:
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.con trols.add(newLa bel)
Next

PlaceHolder is a placeholder on your page

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 18 '05 #3
"Bart Schelkens" <BS********@hot mail.com> wrote in news:#dkmvJipEH A.3424
@TK2MSFTNGP11.p hx.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/vastmAddHandler Statement.asp

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2372
by: dfreas | last post by:
I'm using Bloodshed Dev-C++ to write a program used to calculate orders for my business. Until recently a command line program has been sufficient but it is beginning to become cumbersome so I've switched to writing a windows program and am learning the API as I go. If I use a term wrong correct me - my experience in windows programming is limited, I do however understand C++ fairly well as I've been using it for about four years. I...
0
2155
by: Sinisa | last post by:
I have a Windows form which has multiple groups of the same window controls. I wanted to create a control class that has the standard controls in one. something like: public class Sensor : System.Windows.Forms.Control { private System.Windows.Forms.TextBox Calculation;
1
3087
by: rp | last post by:
Hi, How would I create runtime tabpages with runtime controls(textBoxes,comboBox, checkedListBox), inserting,deleting, and modifing the tabpages whenever I want to in C#? Thanks in advance. rp
15
6750
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use javascript or vbscript it works. I will appreciate any help. I do the following (C#):
2
2898
by: Anand Sagar | last post by:
I have a Panel1 and button1 on my webform. At runtime, I create 2 textboxes. I do it at the Page_Load event. I put the code within the " If Not isPostBack" For the button click event, I will do a post-to-database coding and then show the same page again. I put EnableViewState = True for the textboxes. In the Page_Load if I dont use the IsPostBack checking, the code works fine. The button shows that the code has been fired and the page...
8
4190
by: Jason | last post by:
Hi everyone, Have a small problem which I hope you can help me with. I'm trying to create several link buttons at runtime which run a routine when clicked. I've tried to create a VERY basic example before I carry on, but even this isn't working.
12
3175
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass something else that strings between the domains...
7
2227
by: Varangian | last post by:
Hello is creating controls at runtime the same as designtime ? will a page be faster if controls are created at designtime rather than at runtime ? If so why ? thanks :)
5
1316
by: Kristen | last post by:
I am using ASP.Net 2.0 and I need to create a web page on the fly based on what information is in the database. The page is going to have certain controls like text boxes and labels and buttons. I was wondering what the best method is to carry this out. I was thinking about using a class to generate the HTML on the fly or maybe a stored procedure. Can anyone point me in the right direction? Thanks
5
2000
by: Guillaume BRAUX | last post by:
Hello, What I want to do is to add a userControl to a form class witch is a different class from the one the button is generated. For example, I want to instanciate a label in "class1" and add it ("show it") on a WinForm situated in "class2" (without having to add code to class2 !) The problem is that I need to instanciate "class2" from "class1" to be able to do a class2.controls.add(myLabel) in class1..
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10037
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.