How can I execute one method after another?

-1

I have a question if this is possible. I have two drop-down lists, but they are divided into 2 different methods since each one has different functions.

He asks me is I do not know if it is possible to declare the call of it. As for example;

private void Dropdownlist()
{
//Lista desplegable
//Cuando se eliga Item #1 ejecutar el solo el Método Habilitar_uno
//Cuando se eliga item #2 Ejecutar el solo el Método Habilitar_dos
}

 public void Habilitar_uno(object sender, EventArgs e)
 {
 //funciones
 }

 public void Habilitar_uno(object sender, EventArgs e)
 {
 //Funciones

 }
    
asked by Alias Wright 10.08.2018 в 21:10
source

1 answer

0

I think you mean this, and if it is not, explain what you're looking for better. : D

private void Dropdownlist()
{
        var valor = ddl1.Value;
        if (valor == "algo")
        {
               ddl2.DataSource = Cargar1();
               ddl2.DataBind();
        }
        else
        {
               ddl2.DataSource = Cargar2();
               ddl2.DataBind();
        }
}
    
answered by 10.08.2018 в 21:30