How to make a waterfall dropdownlist ASP.NET MVC5

0

I have the following code, I need that according to the selected brand shows me the class, ayudaaaa is urgent. CONTROLLER

    public IActionResult Index()
    {

        //Marca
        Task < ServicioMVCDatoAuto.TiposReferencia> TareaMarca = obj2.ObtenerVehiculoMarcaAsync("", ServicioMVCDatoAuto.TipoVehiculo.Auto);
        TareaMarca.Wait();
        if (TareaCiudad.Result.DescripcionError != "")
            MostrarError("Marca", TareaMarca.Result.DescripcionError);
        else
            ViewBag.MostrarMarca = LlenarcomboReferencia<ServicioMVCDatoAuto.TipoReferencia>((TareaMarca.Result.ListaTipoReferencia.ToList<ServicioMVCDatoAuto.TipoReferencia>()));

        //Clase
        Task<ServicioMVCDatoAuto.TiposReferencia> TareaClase = obj2.ObtenerVehiculoClaseAsync("", ServicioMVCDatoAuto.TipoVehiculo.Auto, ResultMarca);
        TareaClase.Wait();
        if (TareaCiudad.Result.DescripcionError != "")
            MostrarError("Clase", TareaClase.Result.DescripcionError);
        else
            ViewBag.MostrarClase = LlenarcomboReferencia<ServicioMVCDatoAuto.TipoReferencia>((TareaClase.Result.ListaTipoReferencia.ToList<ServicioMVCDatoAuto.TipoReferencia>()));
  return vew()}    

View                                     Brand                 

                @Html.DropDownList("MostrarMarca", null, "--Seleccione marca--", new { @class = "form-control", @onChange = "imprimirValor();" })

        </div>
        <div class="col-md-4">
            <label>Clase</label>
            <br />
            @Html.DropDownList("MostrarClase", null,"--Seleccione Clase--", new { @class = "form-control" })
        </div>
    </div>

in this javascript I take the data

    function imprimirValor() {
        /* Para obtener el valor */
        var cod = document.getElementById("MostrarMarca").value;
        alert(cod)
    }
    
asked by Jonathan Gomez 24.08.2018 в 17:38
source

0 answers