473,387 Members | 1,510 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,387 software developers and data experts.

Q: go though a dropwdownlis items

Hello

I have TextBox1 and TextBox2 and Button1 and Button2. I also have
DropDownList1.
Now, when I click Button1 I want to concatenate “TextBox1 - TextBox2” and
add this item to DropDownList1.
If I have clicked Button2 I can to go though DropDownList1 and see what
items are there.

Can anyone write me C# code for this. I am quite new in ASP.Net environment.
Thanks,

Jan 12 '06 #1
1 824
Hi Jim,

1. Add item ddl:

DropDownList1.Items.Add(TextBox1.Text + " - " + TextBox2.Text);
2. Loop thru ddl:

foreach (ListItem item in DropDownList1.Items)
{
string txt = item.Text;
}
HTH

Elton Wang

"JIM.H." wrote:
Hello

I have TextBox1 and TextBox2 and Button1 and Button2. I also have
DropDownList1.
Now, when I click Button1 I want to concatenate “TextBox1 - TextBox2” and
add this item to DropDownList1.
If I have clicked Button2 I can to go though DropDownList1 and see what
items are there.

Can anyone write me C# code for this. I am quite new in ASP.Net environment.
Thanks,

Jan 12 '06 #2

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

Similar topics

12
by: Donnal Walter | last post by:
The following method is defined in one of my classes: def setup(self, items={}): """perform setup based on a dictionary of items""" if 'something' in items: value = items # now do something...
4
by: mb | last post by:
what is the best way to do this: In a game I want to a class called "Items". This class will have the game items public class Items { public int Chair public int Table . . .and so on . . .
2
by: dave | last post by:
This little problem is driving me nuts!! On my webform page I create 2 variables.. Protected p_dml As String = "I" Public Const mwv_id As Integer = 0 ' originally had mwv_id as Protected
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
2
by: hsuntn | last post by:
I am grabbing Outlook MailItems using the Items property on my Outlook inbox. When I iterate through them, I notice that they are not ordered in ReceivedTime or CreationTime order. For example, ...
4
by: pmacdiddie | last post by:
Hi, I posted this a while ago, and I though I got a solution. I added referencial intergrity between the tables "tblJobs" and tblJobsLineItems" as was suggested. The time went to .5 seconds....
2
by: John Nagle | last post by:
A list of small problems and bugs in the current M2Crypto: I need to look at SSL certificates in some detail, so this is all about the access functions for certificates. Bugs: 1. Off by one...
2
by: tommytash | last post by:
Hi, I have a datagrid with a checkbox column, and when, after the user clicks a button, I do the famous "for each (datagriditem variable) in datagrid.items....next", the datagrid.items.count is 0,...
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.