Question

UPDATE:

Thanks to @ngm comment i have downloaded the build from bitbuket and found that indeed the file is not located in the correct path.

I looked again in the repository in bitbucket and it's there ... How can that happen ?


ORIGINAL POST:

I have created the following editor template:

@model CamelotFaultManagement.Models.OptionListViewModel
<div class="btn-group">

@foreach (var item in Model.ListItems)
{
    string RadioButtonID = ViewData.ModelMetadata.PropertyName+item.ItemID; 

    @Html.RadioButtonFor(m => m.SelectedItemID, item.ItemID, new { id = RadioButtonID })
    <label class="btn" for="@RadioButtonID">@item.ItemName</label>
}

</div>

and i placed the OptionListViewModel.cshtml in Views/Shared/EditorTemplates

And used it in the following view:

<div class="editor-label">
    @Html.LabelFor(model => model.FaultTypeID)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.FaultTypeID)
    @Html.ValidationMessageFor(model => model.FaultTypeID)  
</div>

model.FaultTypeID is of type OptionListViewModel

When i run my app locally everything works just fine but after deployment to appharbor it dose not work, as if it cannot find the editor template at all (see screenshots). Local

AppHarbor

Was it helpful?

Solution

So... Many thanks to @ngm for pointing me to the right direction..

The OptionListViewModel.cshtml was not included in the release build in app-harbor for some reason.. After looking into the porject file chages in git i have notieced that the build action for that specific editor template view was set to "none" for some reason.. I have change it to "content" and now app-harbor copies the file and everything works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top