title: I got an error '+=' cannot be applied to operands of type 'System.DateTime' and 'System.EventHandler' while executing the following code
body: <pre><code>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;
  </code></pre>
  
  <p>Error happens in this line:</p>
  
  <pre><code>((Calendar)ctrl).SelectedDate += new EventHandler(Item_Selected);
  </code></pre>
  
  <p>Can anyone help?</p>