X
Xavier Pacheco
Can anyone make heads or tails out of this? I have a DataList control
that contains a DropDownList and a HyperLink control. The HyperLink
control initiates a command named "REGISTER".
The following code executes, I find the DropDownList, but it contains
no values. IOW, it appears to be empty.
Am I going about this correctly? When the user presses the hyperlink
contained in the ItemTemplate of the DataList, I want to get the
selected value of the DropDownList, also contained in the Item Template
of the DataList.
private void DataList1_ItemCommand(object source,
system.Web.UI.WebControls.DataListCommandEventArgs e)
{
if ( e.CommandName == "REGISTER" )
{
string ctl_name = String.Format( CTRLNAME, e.Item.ItemIndex );
DropDownList ddl = (DropDownList)e.Item.FindControl(
"DropDownList1" );
int EventInstanceID = Int32.Parse( ddl.SelectedValue );
}
}
Any ideas ?
- x
that contains a DropDownList and a HyperLink control. The HyperLink
control initiates a command named "REGISTER".
The following code executes, I find the DropDownList, but it contains
no values. IOW, it appears to be empty.
Am I going about this correctly? When the user presses the hyperlink
contained in the ItemTemplate of the DataList, I want to get the
selected value of the DropDownList, also contained in the Item Template
of the DataList.
private void DataList1_ItemCommand(object source,
system.Web.UI.WebControls.DataListCommandEventArgs e)
{
if ( e.CommandName == "REGISTER" )
{
string ctl_name = String.Format( CTRLNAME, e.Item.ItemIndex );
DropDownList ddl = (DropDownList)e.Item.FindControl(
"DropDownList1" );
int EventInstanceID = Int32.Parse( ddl.SelectedValue );
}
}
Any ideas ?
- x