【问题标题】:An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll asp.net-mvcmscorlib.dll asp.net-mvc 中发生了“System.StackOverflowException”类型的未处理异常
【发布时间】:2015-02-25 18:52:27
【问题描述】:

我在查看 ASP.NET MVC 应用程序时遇到以下运行时错误:

在 mscorlib.dll 中发生了“System.StackOverflowException”类型的未处理异常

就在return View(); 之前,一切都很好。在视图中我几乎没有任何代码:

@{
    ViewBag.Title = "Test";
}

@(Html.EJ().Schedule("Schedule1", 
                     (Syncfusion.JavaScript.Models.ScheduleProperties)ViewBag.Model))

但正是这一行引发了异常。我也没有在ViewBag.Model 中看到任何可疑之处。

如何调试此错误?堆栈跟踪为空。

【问题讨论】:

标签: c# asp.net-mvc stack-overflow


【解决方案1】:

Syncfusion support forum 上的此线程表明该问题是由启用不显眼的验证引起的。如果您可以禁用它,那可能是您最好的选择。否则,他们提出了这个相当冗长的解决方法:

@(Html.EJ().Schedule("Schedule1")

        .Width("100%")

        .Height("525px")

        .CurrentDate(new DateTime(2014, 6, 1))

        .ScheduleClientSideEvents(even=>even.CellClick("onCellQuickWindowClose").AppointmentClick("onAppQuickWindowClose"))

        .CategorizeSettings(Fields => Fields.Datasource((System.Collections.IEnumerable)ViewBag.categorize).Enable(true).AllowMultiple(false).Id("id").Text("text").Color("color").FontColor("fontColor"))

        .ContextMenuSettings(menu => menu.Enable(true).MenuItems(item => item.Cells(ViewBag.cell).Appointment(ViewBag.app)))

            .AppointmentSettings(fields => fields.Datasource((System.Collections.IEnumerable)ViewBag.datasource)

            .Id("Id")

            .Subject("Subject")

            .StartTime("StartTime")

            .EndTime("EndTime")

            .Description("Description")

            .AllDay("AllDay")

            .Recurrence("Recurrence")

            .RecurrenceRule("RecurrenceRule")

            .Categorize("Categorize"))

)





<script type="text/javascript">

    function onCellQuickWindowClose(args) {

        var dialog = $("#Schedule1AppointmentQuickWindow").data("ejDialog");

        dialog.close();   // Here we are closing the quick appointment window

    }

    function onAppQuickWindowClose(args) {

        var dialog = $("#Schedule1AppDetailsWindow").data("ejDialog");

        dialog.close();   // Here we are closing the quick appointment window

    }

</script>

该线程还提供了以下下载链接以获取上面显示的代码:

http://www.syncfusion.com/downloads/support/directtrac/general/ScheduleNuget-2089236857.zip

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多