Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
protected override void CreateChildControls()
{
CheckBoxList list = new CheckBoxList();
PageDataCollection pages = GetPages();
foreach(PageData page in pages)
{
ListItem item = new ListItem(page.PageName,page.PageLink.ToString());
item.Selected = Subscription.IsSubscribingTo(page.PageLink);
list.Items.Add( item );
}
list.SelectedIndexChanged += new EventHandler(SaveSubscriptions);
Controls.Add(list);
}
protected void SaveSubscriptions(object sender, EventArgs e)
{
CheckBoxList list = sender as CheckBoxList;
foreach(ListItem item in list.Items)
{
if(item.Selected)
Subscription.SubscribeTo( PageReference.Parse(item.Value) );
else
Subscription.UnSubscribe( PageReference.Parse(item.Value) );
}
}
public class AB_SubscriptionList : SubscriptionList
{
//Constructor - use SubscriptionList constructor
public AB_SubscriptionList(): base(){}
//----- de overrides som jag vill göra ----
}
Hur löser jag detta?