I have a ViewModel called LogViewModel in which I have 3 properties as shown below.
public class LogViewModel
{
public IEnumerable<Log> Logs { get; private set; }
public PaginationHelper Pagination { get; set; }
public LogFilter Filter { get; set; }
}
LogViewModel is passed to View as Model. Now I need to pass the LogFilter (with data) in a partial view, for example:
@Html.Partial("_LogsFilter", Model.Filter)
I tried many methods, but always get the same error:
The model element passed to the dictionary is of type 'Infrastructure.Presentation.Desk.ViewModels.LogViewModel', but for this dictionary a model element of type 'Infrastructure.Presentation.Desk.Models.LogFilter' is required.
Any thoughts?
source
share