E
echan8
I have a dropdown list in a datagrid which I am dynamically adding
items to with JavaScript.
When I try to access the value of the dropdown list on postback, there
is no value. The value is null. I get the feeling I'm supposed to do
something else, but I'm not sure what.
If anyone can help, I would appriciate it. Thanks.
foreach( DataGridItem di in DataGrid1.Items )
{
DropDownList ddl = (DropDownList) di.FindControl("ddlItems");
Label lblID = (Label)di.FindControl("id");
int id = Convert.ToInt32(lblID.Text);
int itemvalue = Convert.ToInt32(ddl.SelectedValue); // the
item value here is null
// Do stuff with items here.
}
items to with JavaScript.
When I try to access the value of the dropdown list on postback, there
is no value. The value is null. I get the feeling I'm supposed to do
something else, but I'm not sure what.
If anyone can help, I would appriciate it. Thanks.
foreach( DataGridItem di in DataGrid1.Items )
{
DropDownList ddl = (DropDownList) di.FindControl("ddlItems");
Label lblID = (Label)di.FindControl("id");
int id = Convert.ToInt32(lblID.Text);
int itemvalue = Convert.ToInt32(ddl.SelectedValue); // the
item value here is null
// Do stuff with items here.
}