Retrieve data from Header template of Datalist
-
23-09-2019 - |
문제
I have one checkbox
control in Datalist
Header and some 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>");
제휴하지 않습니다 StackOverflow