1

On my home page (which uses the HomePage model) I need to call a partial which uses a different model.

I keep getting the error:

The model item passed into the dictionary is of type 'Site.Models.HomeModel', but this dictionary requires a model item of type 'Site.Models.DifferentModel'

How I'm trying to call my partial view.

@Html.Partial("~/Views/Shared/_partialItem.cshtml")

is there a way of doing this without changing the controller?

thanks.

Elliott
  • 25
  • 5

1 Answers1

1

try @Html.Partial("~/Views/Shared/_partialItem.cshtml",new DifferentModel(){})

Nic
  • 1,088
  • 3
  • 19
  • 43