On an ASP.NET Core 2.0 application I need to render a partial view and pass a few parameters:
@Html.Partial("Form", new { File = "file.pdf" })
On the partial view I tried to access it using:
@Model.File
And I get the error:
RuntimeBinderException: 'object' does not contain a definition for 'File'
If I simply use on my partial:
@Model
I get the following printed on the page:
{ File = file.pdf }
So there the model is being passed and there is a property File in it.
So what am I missing?