2
I am developing an application, where I have a Viewbag listing a list of numbers, from my database.
I need to write the selected number in this dropdown, in another Viewbag. I don’t know how to do this, someone could help me?
Viewbag returning the list of numbers:
ViewBag.Contrato = usuarioRepository.Lista.Where(u => u.sLogin == autenticacaoProvider.UsuarioAutenticado.Login).Select(u => u.SqContrato);
View with the Dropdownlist:
@Html.DropDownList("Contrato", new SelectList(ViewBag.Contrato, "Contrato"))
There is some syntax, like "@Html.Dropdownlistfor(@Viewbag)"?
Ih ai ok? The functioning of the forum here is a little different from other forums. When requesting some post information use the option Comment on. In this case answers would only be the answers to the post. View http://answall.com/tour. for more information and familiarize yourself. And welcome to the community.
– Jothaz
Sorry for the lack of knowledge. From now on, I will use the forum correctly.
– Randrade
I also made a lot of mess at first. I’m Jothaz you remember?
– Jothaz