views:

16

answers:

1

I'm trying to make the selected item the value of an asp:Label if this is possible

I am putting my drop down list in like this

For ddlAdults As Integer = 1 To strNumberSlept
CType(e.Item.FindControl("ddlEditAdults"), dropdownlist).Items.Add(new ListItem(ddlAdults.ToString(), ddlAdults.ToString()))
Next ddlAdults

And I need to add a selected item in to be the value of strSelectedItem

Dim strSelectedItem = CType(e.Item.FindControl("lblAdults"), label).Text

Not sure how to add this in dynamically

Any ideas?

Thanks

Jamie

A: 

I've figured it out

CType(e.Item.FindControl("ddlEditAdults"), dropdownlist).SelectedValue = CType(e.Item.FindControl("lblAdults"), label).Text

Thanks

Jamie

Jamie Taylor