473,378 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1391
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. how can i achive that? -- Thanks Hitesh
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 to add mutiple selected items to another listbox...
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 to them. Now because there are 4 seperate...
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 Visual Studio before with 1 ASP.NET application,...
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 from same file. So some errors while at the time...
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....... ========= =C:\\a.xml=
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 results. I was wondering if someone can help me...
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 multiple rows.....if this happens then i should...
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 have a shrink wrapped desktop application which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.