A
Azmat
Hi everyone...whats wrong here?
I created two dropdownlists in an aspx file. I populated both of them
with 3 simple listitems -- basically containing the numbers 1,2,3.
So I have
dropdownlist1 and dropdownlist2
They both contains 3 list items. The first one's value/text is 1, the
second one's is 2 the third list item's is 3.
Now, I want one dropdownlist to display the number 2 and the other to
display the number 3.
This is what I did.
DropDownList1.SelectedIndex = 1;
DropDownList2.SelectedIndex = 2;
It compiles and runs. However BOTH dropdownlists contain 3 (index =
2) as the selected item. and not just dropdownlist2.
cant figure it out.
Thanks in advance!
azmat
I created two dropdownlists in an aspx file. I populated both of them
with 3 simple listitems -- basically containing the numbers 1,2,3.
So I have
dropdownlist1 and dropdownlist2
They both contains 3 list items. The first one's value/text is 1, the
second one's is 2 the third list item's is 3.
Now, I want one dropdownlist to display the number 2 and the other to
display the number 3.
This is what I did.
DropDownList1.SelectedIndex = 1;
DropDownList2.SelectedIndex = 2;
It compiles and runs. However BOTH dropdownlists contain 3 (index =
2) as the selected item. and not just dropdownlist2.
cant figure it out.
Thanks in advance!
azmat