I’m having a mvc form which among other things contains an int that should be mapped to text strings displayed in a dropdown.
MyViewModel
{
...other fields...
int Level { get; set; }
...other fields...
}
Is it possible to use RenderAction for the Level field and generate the dropdown from a separate action?
I hope this question is coherent, I’m quitting coffee and my head isn’t where it usually is.
Although many people will advise (rightly so) not to do this but if you insist you can do something like
as you want to reuse this dropdown you can accept its html name attribute as action method parameter
in your view you can write something like