page load的时候,“index0的S elected = true”,你再选一个index1的S elected 也 true了,就会报错。
所以一般不要用“d ropDownList.Items[x].S elected = true/false”,用“d ropDownList.S electedIndex = x”比较好。
试试下面的代码:
d ropDownList.S electedIndex = d ropDownList.Items.IndexOf(d ropDownList.Items.FindByValue(myValue));
回答评级:★★☆☆☆☆☆☆☆ 回答者:{chengg}chengg 10-25
回答