I have a partial page which is passed a list of Events (where an event is a custom Model). This works fine:
@model IEnumerable<Entry>
@using MySite.Models
Within the partial page I iterate through the list of Entry's in the model:
@if (Model.Count() > 0)
{
foreach (var entry in Model)
{
...
This works fine as well. However, within this foreach
loop I want to send the data of the entry to another partial view:
@await Html.PartialAsync("/Pages/Shared/ShareMedia/shareMedia.cshtml", @entry)
Within this partial I have declared the following:
@model Entry
However this seems t return an error:
error CS0118: 'Entry' is a namespace but is used like a type
If I then try to add the full path of the model
@model MySite.Models.Entry
I get the following error when trying to load the partial:
Uncaught ReferenceError: MySite is not defined
at HTMLImageElement.onclick ((index):1)
Is there any advice anyone might be able to give to help me get around this. I have done some googlinig but not getting any direction.
Any advice is greatly appreciated!