beginner ?

  • Thread starter Thread starter AussieRules
  • Start date Start date
A

AussieRules

Hi,

In VB you can add an object to a combo such as

dim ob as object
ob.id = 1
ob.name = 'sample'
cbobox.items.add(ob)

These does not seem to work in asp.net.

How can I do this, I want to add object items into a dropdown, and when the
user selects an option I can get the id value. The name is no use to me, as
the administrator can change it based on there language.

Thanks
 
think now you have to create a ListItem
and you then add the listitem to the items collection.
 
Dropdownlist1.Items.Add(new Listitem("text","value"));

on selection
Dropdownlist.SelectedValue will be equal to "value"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Metro 2033 on my Arch/Skylake 8
Option Button Grouped 13
Relative URLs 6
Response. 2
Inserting Flash - Why JavaScript? 2
Object deconnected 1
Deleting rows - syntax wrong? 4
Combobox 6

Back
Top