i have a few dropdownlists on a page. in each ddl, there is a list of values and the selected values are then supposed to be stored. for some oddball reason...only one of the ddl values are being passed. completely unsure of what's wrong. just to be sure, for productDDL...i have it set so that it DISPLAYS a productName, but PASSES the productCode
aspx page:
<asp:DropDownList ID="soooDDL" runat="server">
<asp:ListItem Value="1">happy</asp:ListItem>
<asp:ListItem Value="2">glad</asp:ListItem>
<asp:ListItem Value="3">sad</asp:ListItem>
<asp:ListItem Value="4">mad</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="frDDL" runat="server">
<asp:ListItem Value="CT">CT</asp:ListItem>
<asp:ListItem Value="JT">JT</asp:ListItem>
<asp:ListItem Value="F">F</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="productDDL" runat="server" DataSourceID="productDS"
DataTextField="productName" DataValueField="productCode">
</asp:DropDownList>
<asp:SqlDataSource ID="productDS" runat="server"
ConnectionString="<%$ ConnectionStrings:connSTR %>"
SelectCommand="SELECT * FROM [productTable]"></asp:SqlDataSource>
<asp:Label ID="productCodeLabel" runat="server" Text="Label"></asp:Label>
</pre>
i have a busObj that stores the values.
so far...the only one that seems to store anything is the frDDL one which sends the ctjtf
private string sooo_BO;
private string ctjtf_BO;
private string productCode_BO;
public string setodosou
{
get
{
return sooo_BO;
}
set
{
value = sooo_BO_BO;
}
}
public string ctjtf
{
get
{
return ctjtf_BO;
}
set
{
ctjtf_BO = value;
}
}
public string productCode
{
get
{
return productCode_BO;
}
set
{
productCode_BO = value;
}
}
this seems to work for ctjtf...i've tried the EXACT same code and...nothing for the other two
lBO.ctjtf = frDDL.SelectedValue.ToString();
this, as i said...sends the proper value through to the busObj
focusing on just the soooDDL...
attempt 1:
lBO.setodosou = soooDDL.SelectedValue;
in local...i see null value for the string even though i selected a product
attempt2:
lBO.setodosou = soooDDL.SelectedValue.ToString();
in local...null value...again, this is the exact same thing i used for the ctjtfDDL and i can see that one worked just fine. there's definitely the proper value stored in memory.
attempt3:
lBO.setodosou = soooDDL.SelectedItem.Value;
still...null value and what's weird here is when i write out the line, if i hover over ".Value" in codebehind, I can see that the "value" is what I selected, yet for some reason...the variable isn't being passed