【问题标题】:Webgrid data not showing up when published to Azure发布到 Azure 时未显示 Webgrid 数据
【发布时间】:2019-10-29 08:36:38
【问题描述】:

我正在处理从 SharePoint 列表中获取信息并将其放入 WebGrid 的页面。目前它与 localhost 完全兼容,所有数据都显示出来了,但是一旦我发布它并导航到页面,这些页面上唯一显示的是来自网格本身的标题,并且在检查控制台时没有错误.

我尝试查看它是否是我的 jQuery,但这似乎不是因为标题正在工作,并且使用 jQuery 的应用程序的其他部分也在工作。 对 SharePoint 的身份验证也有效,因为同一应用程序的不同部分可以访问同一列表并更新信息。

@model List<CalendarEvent>

@{
ViewBag.Title = "Dashboard";
var grid = new WebGrid(Model, canPage: true, rowsPerPage: 10,
selectionFieldName: "selectedRow", ajaxUpdateContainerId: "gridContent");
grid.Pager(WebGridPagerModes.NextPrevious);
<link rel="stylesheet" type="text/css" href="/Content/site.css" />
<link rel="stylesheet" type="text/css" href="~/Content/custom.css" />
}

<main class="vh-main container">
<div id="mainControls" class="container body-content">
    <h2 class="AppointmentHeader">Your Appointments</h2>
    <div id="gridContent">
        @if (Model != null)
        {
            @grid.GetHtml(tableStyle: "webgrid-table",
              rowStyle: "webgrid-row-style",
              alternatingRowStyle: "webgrid-alternating-row",
              mode: WebGridPagerModes.All,
              headerStyle: "webgrid-header",
              footerStyle: "webgrid-footer",
              selectedRowStyle: "webgrid-selected-row",
              columns: grid.Columns(
                  grid.Column("Subject", "Subject"),
                  grid.Column("PatientName", "Patient Name"),
                  grid.Column("StartDate", "Start Date/Time", format: (item) => item.StartDate.DateTimeValue.ToString("MMM dd, yyyy h:mm tt")),
                  grid.Column("EndDate", "End Date/Time", format: (item) => item.EndDate.DateTimeValue.ToString("MMM dd, yyyy h:mm tt")),
                   grid.Column("MeetingUrl","Join Meeting",
                                 format: @<text><a href="@item.MeetingUrl">Join Meeting</a></text>)
                                    ));
        }
        else
        {
            <div id="gridEmptyMessage">
                <b> There are no appointments scheduled for today </b>
            </div>
        }
    </div>
</div>

【问题讨论】:

    标签: .net azure sharepoint webgrid


    【解决方案1】:

    在这种情况下要检查几件事:

    1) 在浏览器的开发者工具中打开网络标签,查看获取数据表单分享点的api是否有返回数据。

    2) 添加日志并检查模型是否有数据。

    3) 在开发工具中,检查 div 或 Web 网格并检查您的表格行和列是否可见而不是隐藏。

    4) 还可以在开发工具的控制台中检查与 web 网格相关的任何内容,无论是 CSS、jquery 还是任何其他库。

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-13
      • 2015-05-24
      • 1970-01-01
      • 2013-07-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多