I'm having the following problem: I need to send, instead of Id
of ViewBag
, Municipio
, which is contained in ViewBag.Cidades
.
How do I change from Id to Municipio
when I click Search to send the municipality through the controller?
@using (Html.BeginForm("Colecao", "Cliente", FormMethod.Get))
{
<td>
@Html.DropDownList("Id", (IEnumerable<SelectListItem>)ViewBag.Cidades)
</td>
<input type="submit" value="Buscar" class="btn btn-default" />
}