Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
Cómo mostrar/ocultar una entrada basada en el elemento seleccionado en otra lista desplegable en .net core 2.1 MVC

Tengo esta lista desplegable:

 <div class="form-group" id="businessEntitiesIdsLegal"> <label asp-for="BusinessEntityTypeId" class="control-label col-sm-4 col-lg-3" asp-show-required-charachter="true">Some label</label> <div class="col-sm-5 col-md-4 col-lg-3"> <select asp-for="BusinessEntityTypeId" id="BusinessEntityTypeId" asp-items="Model.BusinessEntities" class="select2 select-block-level search"> <option value="@BaseViewModel.NotSelected">Choose something</option> </select> <span asp-validation-for="BusinessEntityTypeId" class="text-danger"></span> </div> </div>

y me gustaría manejar si su elemento seleccionado con valor = 2 luego mostrar este div (y también si el elemento se cambia, para ocultar el div):

 @if(Model.BuyerTypeId == BuyerTypeEnum.Legal.Id) { <div class="form-group" id="foobar"> <label asp-for="Jbkjs" class="control-label col-sm-4 col-lg-3"></label> <div class="col-sm-5"> <input asp-for="Jbkjs" type="text" class="form-control" maxlength="5"> <span asp-validation-for="Jbkjs" class="text-danger"></span> </div> </div> }

¿Cómo puedo conseguir esto?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!