Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

136
Visualizações
Updating the ListBox values in MVC on event change

I have a DropDownListFor and ListBox as defined below in my Razor view.

@Html.DropDownListFor(m => m.drpid, new SelectList(Model.List,"value","text",Model.DDselected))
@Html.ListBox("lstid", new MultiSelectList(Model.List2,"value","text",Model.LBselected))

Now when the dropdown value is changed i want to listbox item to be updated accordingly.

I have used change function of jQuery as below

$("#drpid").change(function() { ........ }

Now in this change function I want to assign the values present inside array (1,2,3) to be selected in ListBox and I am unable to do so. Could you please help me in updating/resetting the ListBox values using jQuery/javascript in this change function.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda