When you pass a variable as the second parameter to the Partial() method, it becomes a model for a partial call. In this case, you pass the ID as the whole model, so you just need to use @Model to get the identifier:
@*Page View*@ @model MyModel ... @Render.Partial("MyControl",@Model.ID)
.
@* MyControl Partial View *@ @model int @myid = @Model
If you want to pass the PartialViewModel type to your partial one, you must specify this as a property in the Parent ViewModel (model in the first example) or through the ViewData or ViewBag containers.
source share