472,353 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

how to create mutiple control with same ID

wpy
Hi,

Does anybody know how to create multiple control with same ID or name in
asp.net and request the controls's value in array form? For example the vb
control can have same same but with different index.

Thanks.
Nov 17 '05 #1
1 1334
With .NET, control collections are gone (and for good reason too! ;) ). What
you can do is create an object collection and add the individual controls to
that collection and then modify them that way.

IE:

LinkButton lb1 = new LinkButton();
LinkButton lb2 = new LinkButton();
LinkButton lb3 = new LinkButton();
LinkButton lb4 = new LinkButton();

LinkButton[] linkbuttons = { lb1, lb2, lb3, lb4 };

foreach(LinkButton lb in linkbuttons)
{
lb.Text = "Hello There";
}

---or---
for(int i=0;i<linkbuttons.Length;i++)
{
linkbuttons[i].Text = "I am link button " + i.ToString();
}

HTH,

Bill P.

"wpy" <wp*@3ntity.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

Does anybody know how to create multiple control with same ID or name in
asp.net and request the controls's value in array form? For example the vb control can have same same but with different index.

Thanks.

Nov 17 '05 #2

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

Similar topics

4
by: Hitesh | last post by:
Hi, I have three datagrid control on my aspx page and one export to excel button, i want to export all the 3 datagrids contents in one excel file....
0
by: deepak | last post by:
i have set multiple selection property in bith listboxes(html control) to true. i have taken 2 buttons(html control) say Button1,Button2.now i want...
2
by: Martin | last post by:
Hi, I have a page with 4 web user controls on. Each of these web user controls has some asp.net controls on that have validation events attached...
0
by: Shawn | last post by:
Hi, I am trying to create a setup project for a install, which includes 3 XML web services, 1 ASP.NET application. I've done setup project in...
1
by: Mamatha | last post by:
Hi friends, I have an application using mutithreads.In that application one threads writes the data in to a file. Another thread reads the data...
0
by: saravana | last post by:
I have to display the mutiple xml filename path in treeview control using c#. net some thing like this In treeview control..........
2
by: whitethomas12 | last post by:
Hi, I currently have some basic code that allows me to run the tracert command through VB.NET and it also updates my database based on the...
2
by: ravitunk | last post by:
hi..i have a datagridview in my windows application using C#......i want to select mutiple cells(by pressing shift key) or select mutiple columns or...
2
by: Peter | last post by:
Firstly let me be very clear about this, I do not want to create a web service proxy nor do I want to do anything with web services. Basically, I...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.