public void MotoresDropDownList() { Motores motor = new Motores(); MotorDropDownList.DataSource = motor.Listado("*", "1=1", ""); MotorDropDownList.DataTextField = "Descripcion"; MotorDropDownList.DataValueField = "MotorId"; MotorDropDownList.DataBind(); MotorDropDownList.Items.Insert(0, "Elige Motor"); }
public void ObtenerDropDownList() { Marcas marca = new Marcas(); MarcaDropDownList.DataSource = marca.Listado(" * ", " 1=1 ", " "); MarcaDropDownList.DataTextField = "Descripcion"; MarcaDropDownList.DataValueField = "MarcaId"; MarcaDropDownList.DataBind(); MarcaDropDownList.Items.Insert(0, "Seleccionar--"); Modelos modelo = new Modelos(); ModeloDropDownList.DataSource = modelo.Listado(" * ", " 1=1 ", " "); ModeloDropDownList.DataTextField = "Descripcion"; ModeloDropDownList.DataValueField = "ModeloId"; ModeloDropDownList.DataBind(); ModeloDropDownList.Items.Insert(0, "Seleccionar--"); Motores motor = new Motores(); MotorDropDownList.DataSource = motor.Listado(" * ", " 1=1 ", " "); MotorDropDownList.DataTextField = "Descripcion"; MotorDropDownList.DataValueField = "MotorId"; MotorDropDownList.DataBind(); MotorDropDownList.Items.Insert(0, "Seleccionar--"); Colores color = new Colores(); ColorDropDownList.DataSource = color.Listado(" * ", " 1=1 ", " "); ColorDropDownList.DataTextField = "Descripcion"; ColorDropDownList.DataValueField = "ColorId"; ColorDropDownList.DataBind(); ColorDropDownList.Items.Insert(0, "Seleccionar--"); TipoVehiculos tipo = new TipoVehiculos(); TipoDropDownList.DataSource = tipo.Listado(" * ", " 1=1 ", " "); TipoDropDownList.DataTextField = "Descripcion"; TipoDropDownList.DataValueField = "TipoVehiculoId"; TipoDropDownList.DataBind(); TipoDropDownList.Items.Insert(0, "Seleccionar--"); }