How to copy dropdownlist to each other?

J

JP

I need to know how to copy one DropDownList to another in a single line.

I have a class method that builds a DropDownList object at runtime. This
object is then returned to the calling ASPX page. I tried:

dropNames = CommonTools.LoadNames(); //returns DropDownList object

LoadNames returns a populated DropDownList object. But the rendered list is
blank even though the debugger says that the class did return with the
correct object.

The only time I can get the DropDownList to display its content is:

dropNames .DataSource = CommonTools.LoadNames().Items


Even then I get the Text options, but the Values are just the same as the
text and not what the “values†the class returned.


How can I accomplish this? Im trying to avoid a FOREACH
 
B

Bill Richards

What possible reason could there be for *needing* to do this in a single
line of code?
 

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

Top