How to use DropDownListFor cascaded in asp.net mvc

0

I use Select2 to populate a dropdown and I would like to choose the item after I update another dropdown or a label by doing a search.

ex:

@Html.DropDownListFor(m => m.IdEstado, Model.CarregarEstado.Select(x => new SelectListItem { Text = x.Nome, Value = x.IdEstado.ToString() }), new { @class = "form-control select2_tipo" })

I need that after selecting the state, look for the bank which country it belongs to.

Thankful

Ulysses

    
asked by anonymous 16.06.2018 / 03:08

1 answer

0

I believe you will have to use javascript for when you select the state, the javascript / ajax pass to the controller the state via httpget, go to the bank and return variable with the country and fill in the field with the desired country name in your View.

At the Bank you will have to register the corresponding State and Country.

    
02.07.2018 / 06:11