0

In the ASP.net MVC 4 framework I've got two displaytemplates for booleans:

One with a picture (bool.cshtml)

@model bool
@if (Model == true)
{
    <div><img src="@Url.Content("~/Content/icons/Action-ok-icon.png")" alt="True" /></div>
}
else
{
    <div><img src="@Url.Content("~/Content/icons/Action-cancel-icon.png")" alt="False" /></div>
}

One with font awesome (boolFA.cshtml):

@model bool
@if (Model == true)
{
    <i class="fa fa-check alert-success"></i>
}
else
{
    <i class="fa fa-times alert-danger"></i>
}

Both are used in different Views in the framework (and working) eg.:

@Html.DisplayFor(x => item.Comment,"boolFA",null)
@Html.DisplayFor(x => Model.Comment,"bool",null)

Due to not updating every changed view I ticked "Delete all existing files prior to publish". Now for some reason the boolFA.cshtml isn't published to the DisplayTemplates Folder where the bool.cshtml is.

Anyone knows what is causing this behavior?

Vulcano
  • 415
  • 10
  • 25

1 Answers1

2

Today I stumbled upon the solution.

In the Files Properties in project the "Build Action" of the file was set to "None". It should have been Content like the other cshtml files. See this question: What are the various "Build action" settings in Visual Studio project properties and what do they do?

Community
  • 1
  • 1
Vulcano
  • 415
  • 10
  • 25