3
Like the gestor.Status
is a bool, or you change the Value
for bool:
lista.Add(new SelectListItem { Text = "Habilitado", Value = "True" });
lista.Add(new SelectListItem { Text = "Desabilitado", Value = "False" });
Or convert your own gestor.Status
for whole:
ViewBag.Status = new SelectList(lista, "Value", "Text", Convert.ToInt32(gestor.Status));
The
gestor.Status
is a bool or an int?– Filipe Oliveira
It’s a bool @Filipeoliveira
– Igor Macedo