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
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