Groups | Blog | Home
all groups > asp.net webcontrols > february 2005 >

asp.net webcontrols : regarding drop down lists



DalePres
2/4/2005 8:07:04 AM
You show all the code except the portion where you are having the problem,
where you "grab value of the list item".

Can you provide more information?

DalePres



[quoted text, click to view]

Tony Jo
2/4/2005 8:33:08 PM
Hi
I'm new to ASP.NET and I have recently had trouble with DropDownLists. I am
binding the list using the following code:

DataSet ds = new DataSet();
adapter.Fill (ds,"Table");


availBeds.DataSource = ds.Tables[0];

availBeds.DataTextField =
ds.Tables[0].Columns["bedname"].ColumnName.ToString();

availBeds.DataValueField =
ds.Tables[0].Columns["bid"].ColumnName.ToString();

availBeds.DataBind();

It seems to work fine, but when I try to grab value portion of the list
item, it doesn't seem to work. I even tried storing the value in a temporary
string data type and then displaying it in a label, but the label does not
display anything. I have tried searching for examples, but most sites show
examples using XML or just simply show the basics.

Is there anything that I missed? Any help would be appreciated.

Thanks in advance

Tony

Tony Jo
2/5/2005 3:13:55 AM
I wasn't entirely sure on how to do it.
I thought this was the way to do it, as it displayed data in the list when i
tested it. Therefore I just thought that was all the code I needed. Could
you point out what I'm missing?


[quoted text, click to view]

AddThis Social Bookmark Button