I have a ASP Repeater
which contains a list of tags and I'd like to see which one of the tag was selected (checked).
Like:
<HeaderTemplate>
<ul class="tags-list">
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="tag" runat="server" AutoPostBack="true" Text='' />
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
The problem that I face is that
protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container, Telerik.Sitefinity.Web.UI.ContentUI.Contracts.IContentViewDefinition definition)
method is fired before and:
void tagList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
var item = e.Item.DataItem as Taxon;
var checkbox = e.Item.FindControl("tag") as CheckBox;
checkbox.Text = item.Title;
checkbox.CheckedChanged += new EventHandler(this.checkbox_Changed);
}
}
gets fired everytime before my callback method:
protected void checkbox_Changed(object sender, EventArgs e)
{
CheckBox tagCheckbox = (CheckBox)sender;
if (tagCheckbox.Checked)
{
}
}
Can anyone guide me what would be the best practice to get the state of the checkbox(es)?