开发者

ASP.Net Selected Item in dynamic drop-down

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 开发者_JAVA技巧

Any ideas?

Thanks

Jamie


I've figured it out

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

Thanks

Jamie

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜