0

I have the following classes: User and Medic, that inherits from User.

User has: Id, Name...

Medic has: Crm (numeric value)...

In a view, I want do display a DropdownList with Medic's Id for options value, and Name (inherited) for display...

But using @Html.DropDownList("MedicId") I have, for default, the Crm property being displayed.

Someone knows a way to set the display property to Name?

tereško
  • 58,060
  • 25
  • 98
  • 150
Marcilio Leite
  • 1,247
  • 2
  • 14
  • 17

1 Answers1

0

Sorry, I have not observed, but in my Controller I have the way to do it

ViewBag.MedicId = new SelectList(db.Medics, "Id", "Nome");
Marcilio Leite
  • 1,247
  • 2
  • 14
  • 17