DropDownList must remember their selection!
I have this example and it works fine...
This page when selected value change make a postback.
Selected value in DropDownList never change.
[C# - CodeBehind]
if (!IsPostBack)
{
ArrayList al = new ArrayList();
al.Add("aa");
al.Add("bb");
al.Add("cc");
DropDownList1.DataSource = al;
DropDownList1.DataBind();
al.Add("dd");
DropDownList2.DataSource = al;
DropDownList2.DataBind();
}
[ASPX page]
<asp:DropDownList AutoPostBack="True" id="DropDownList1"
runat="server"></asp:DropDownList>
<asp:DropDownList AutoPostBack="True" id="DropDownList2"
runat="server"></asp:DropDownList>
Brun
"sklett" <as**@fkd.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have 2 dropdownlist on a page. They have ViewState = true. After I
submit to the page, the selection in the DropDownList is lost. I set a
break in the Page_Load event to make sure that I wasn't re-binding them
somehow... I'm not. So shouldn't they maintain their selection?
Anything you can think of to check?
Thanks-
Steve