I want to use RenderPartial twice in my view with different models associated. The problem is that some properties are present in both models (nickname, password). They have no
First of all, you could use Html.TextBox("input form name", ...)
and set the name to whatever you wish. There's a bigger issue how would you provide a prefix on Html.RenderPartial()
level? You are already providing a model instance. So without changing their view models, there's just one more possibility: to write your own overloads for RenderPartial()
that would take the prefix and pass it on to others.
Check this one out. Someone's written a whole bunch of overloads that support setting prefixes. TextBoxFor rendering to HTML with prefix on the ID attribute
If any is missing you can see the pattern how to extend these with additional ones you may need.