Doubt in html. Viewbag-powered dropdownlist

Asked

Viewed 263 times

0

I’m having the following problem: I need to send instead of the Id of ViewBag, the Municipio, which is contained in ViewBag.Cidades.

How Do I Switch from Id to Municipio when I click Search to send Municipio 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" />
}
  • Municipality is an attribute of Cities?

  • can for more details, copy of the class "Cities" ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.