没有合适的方法来覆盖

No suitable method to override

我正在使用 DayPilot 在月视图中创建日历。

所以在 tutorial 之后,我有这个:

public class Dpm : DayPilotMonth
{
    MyCalendarEntities db = new MyCalendarEntities();

    protected override void OnInit(InitArgs e) // this is where I receive the error
    {
        Update();
    }

    protected override void OnFinish()
    {
        // only load the data if an update was requested by an Update() call
        if (UpdateType == CallBackUpdateType.None)
        {
            return;
        }

        Events = db.Events.ToList();

        DataStartField = "StartDate";
        DataEndField = "EndDate";
        DataTextField = "Event1";
        DataIdField = "ID";

    }
}

我只在 OnInit 方法上收到错误,但在 OnFinish 方法上没有收到错误,即使在基础 class 中它们几乎被声明为相同:

基础Class:

public class DayPilotMonth
{
    protected DayPilotMonth();


    public string BackColor { get; set; }

    public string HeaderBackColor { get; set; }

    public string Id { get; }

    public string NonBusinessBackColor { get; set; }
    public DayOfWeek ResolvedWeekStart { get; }

    public DateTime StartDate { get; set; }

    public CallBackUpdateType UpdateType { get; }
    public DateTime VisibleEnd { get; }
    public DateTime VisibleStart { get; }

    public WeekStarts WeekStarts { get; set; }
    protected Controller Controller { get; }

    protected string DataEndField { get; set; }

    protected string DataIdField { get; set; }

    protected string DataStartField { get; set; }

    protected string DataTextField { get; set; }
    protected IEnumerable Events { get; set; }

    public ActionResult CallBack(Controller c);

    protected virtual void OnBeforeEventRender(BeforeEventRenderArgs e);
    protected virtual void OnCommand(CommandArgs e);
    protected virtual void OnEventClick(EventClickArgs e);
    protected virtual void OnEventMove(EventMoveArgs e);
    protected virtual void OnEventResize(EventResizeArgs e);
    protected virtual void OnFinish();
    protected virtual void OnInit(InitArgs e);

    protected virtual void OnPrepare();
    protected virtual void OnTimeRangeSelected(TimeRangeSelectedArgs e);

    protected void Redirect(string url);
    protected void Update();
    protected void Update(object data);
    protected void Update(CallBackUpdateType type);
    protected void Update(object data, CallBackUpdateType type);
}

我做错了什么?

使用以下方式添加:

using DayPilot.Web.Mvc.Events.Month;

甚至更好:

protected override void OnInit(DayPilot.Web.Mvc.Events.Month.InitArgs e) {..