Warm tip: This article is reproduced from serverfault.com, please click

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

发布于 2020-12-03 07:46:22

My requirement was to add an icon in the same line in which the date is displayed in fullcalendar.cs.

Since i didn't found any event which gave me exact result i decided to go and edit fullcalendar.js.

I had used cell.prepend to add the images but that moved the images on the top and day numbers were coming on the 2nd line.

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>";

This above line work perfectly when i am running the application through visual studio. Image is displayed as expected
But when i published the same code in IIS then then images does come up in the hosted application.

I do checked all the IIS setting , but not able to figure out if this is because of IIS setting or any css of fullcalendar.js

While debugging:

After Hosting:

Questioner
Saurav Sah
Viewed
0
Ding Peng 2020-12-03 17:39:43

According to your description, I think this is because IIS not find icon.png. You can try to create an images directory in the project to store icon.png:

enter image description here

Note that the images directory is in the root directory of the project.

Modify the path of the picture in html:

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