0
Good evening! I made a request to my webapi to search for data to use=it in a DropDownlist @Html.DropDownList("Id","Descricao")
. In My controller, I can pull Webapi results in collection, I treated Json and I put it in my product class, which only has Id and Description List<Produto>
How do I stop, before returning to the view where I will use this list, to create an Object in the list to link to my view template and use as a dropdown?
Just to complement, you have to say which type of your View to bind, in case put something like: @model List<Product>
– Gabriel Coletta
in my case he would have to use "@model Order" and not "@model List<Products>". If he only needs the list, then I would need to change my example
– Ayrton Giffoni