How to copy dropdownlist to each other?

  • Thread starter Thread starter JP
  • Start date Start date
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
 
What possible reason could there be for *needing* to do this in a single
line of code?
 
Back
Top