case "Calendar":
ctrl = new Calendar();
((Calendar)ctrl).ID = GetControlId(index, itemDetails);
((Calendar)ctrl).Attributes.Add("class", "chkClass" + parentIndex.ToString());
if (itemDetails.AttachEvent == true)
{
((Calendar)ctrl).SelectedDate += new EventHandler(Item_Selected);
((Calendar)ctrl).AutoPostBack = true;
}
break;
Error happens in this line:
((Calendar)ctrl).SelectedDate += new EventHandler(Item_Selected);
Can anyone help?
You can not register an event handler to a property. You can register handlers to events;