I have two controllers in my MVC project, each having a Weapon action/view. Both views have their @model property set to a WeaponViewModel with different properties depending on the view, e.g. for one view, ViewModel.Weapon = Axe and for the other view ViewModel.Weapon = Sword. Axe and Sword implement an IWeapon interface so have identical properties.
Since each view renders the same WeaponViewModel, i find it an overkill to have identical Razor code for two views. What I did was to create a View named _Weapon in the Shared folder as such:
@model WeaponViewModel
//razor code goes here
..and in the two views I now only have this code:
@model WeaponViewModel
@{ Html.RenderPartial("_Weapon", Model); }
The result works but my question is: is it correct to use Html.RenderPartial to render (essentially) a complete view? Also, If I later decide to become more granular and create additional partial views in my shared _Weapon view, are there any gotchas to look out for?