如何使用 MVC 在 DataTable JQuery 中包含图像?

How to include an image in DataTable JQuery with MVC?

我想知道,如何在我的项目 MVC 的 DataTable JQuery 插件中正确包含图像?

我已经完成了跟踪,但收到警告错误

enter image description here

这是我的代码和控制器中用于获取数据的方法

enter image description here

enter image description here

在您的代码中,您显示了具有有效 url 的行 [1] 的数据。 错误指的是第 0 行(请参阅您的图像,它在第 0 行第 4 列中显示错误)。 记录 0 中的 url 必须保持一致。 这是来自数据表站点的条款:

  • DataTables 已为 {parameter} 的给定行请求数据 提供但那里没有数据,或者它是 nullundefined (DataTables 不知道,默认情况下如何显示这些参数 查看您的数据是否包含这些值)。

一个可能的解决方案是设置数据表选项以显示 null 的 dedfult 值:

    {
      "data": "UrlImagen", // can be null or undefined
      "defaultContent": "<i>No Image</i>"
    }