G
GuyInTn
Hello all,
I have an asp:dropdownlist that is dynamically filled with a query.
This part is working. The problem I have is when I change the item in
the dropdown list and submit my form, the value for the dropdown list
never changes. It always inserts the value of the first item in the
list.
Here is my dropdown:
<aspropDownList ID="CallReason" DataTextField="call_reason"
DataValueField="id" runat="server" />
Here is the code behind:
cmd2.CommandText = "SELECT id, call_reason FROM <TABLE>";
qlDataReader rdr = null;
cn.ConnectionString = constants.ConnectionString;
cn.Open();
cmd.Connection = cn;
objAcc.Fill_DataReader(cmd2, ref rdr);
CallReason.DataSource = rdr;
CallReason.DataBind();
Can someone tell me what I am doing wrong here?
Thanks.
I have an asp:dropdownlist that is dynamically filled with a query.
This part is working. The problem I have is when I change the item in
the dropdown list and submit my form, the value for the dropdown list
never changes. It always inserts the value of the first item in the
list.
Here is my dropdown:
<aspropDownList ID="CallReason" DataTextField="call_reason"
DataValueField="id" runat="server" />
Here is the code behind:
cmd2.CommandText = "SELECT id, call_reason FROM <TABLE>";
qlDataReader rdr = null;
cn.ConnectionString = constants.ConnectionString;
cn.Open();
cmd.Connection = cn;
objAcc.Fill_DataReader(cmd2, ref rdr);
CallReason.DataSource = rdr;
CallReason.DataBind();
Can someone tell me what I am doing wrong here?
Thanks.