开发者

Retrieve data from Header template of Datalist

开发者 https://www.devze.com 2022-12-18 01:35 出处:网络
I have one checkbox control in Datalist Header and som开发者_StackOverflow中文版e controls in Item Template. On click of the \"Submit\" button in the page I should capture the state of controls from D

I have one checkbox control in Datalist Header and som开发者_StackOverflow中文版e controls in Item Template. On click of the "Submit" button in the page I should capture the state of controls from Datalist.

For Item template I can get the values from datalist.Items property.

How can I get the state of checkbox in "Header Template"?


You can use this:

CheckBox ch = (CheckBox) DataListID.Controls
    .OfType<DataListItem> ()
    .First (a => a.ItemType == ListItemType.Header)
    .FindControl("<CheckBoxID>");
0

精彩评论

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

关注公众号