在 fullcalendar.js 的 fc-day-number 添加图像在发布后不起作用

Adding Image in fc-day-number of fullcalendar.js doesn't work after publishing

我的要求是在 fullcalendar.cs 中显示日期的同一行添加一个图标。

因为我没有找到任何给我确切结果的事件,所以我决定去编辑 fullcalendar.js。

我曾使用 cell.prepend 添加图像,但是这将图像移到了顶部,日期数字出现在第二行。

html += "<div class='fc-day-number'><img class='fc-state-default' src=\"../../icon.png\"/><label style=\"horizontal-align: left; margin-right:22px\">   Virtual/Synchronous</label>    " + cellDate.getDate() + "</div>";

当我 运行 通过 visual studio 应用程序时,上面这行代码工作得很好。图像按预期显示
但是当我在 IIS 中发布相同的代码时,托管应用程序中就会出现图像。

我确实检查了所有 IIS 设置,但无法确定这是因为 IIS 设置还是 fullcalendar.js[的任何 css

While debugging:

After Hosting:

根据你的描述,我认为这是因为IIS没有找到icon.png。可以尝试在项目中创建一个images目录存放icon.png:

注意images目录在项目的根目录下

修改html中图片的路径:

<img class='fc-state-default' src=\"~/images/icon.png\"/>