Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Y

Yayo_Arg

@Yayo_Arg
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ASP CORE Razor page, variable viewbag filter content with dropdownlist
    Y Yayo_Arg

    I have three dropdownlists that I fill with the contents of viewbag variables. I want the content of the second variable to be filtered when I select a value of the first using JQuery or javascript. The same with the third dropdownlist, which is filtered by what is selected in the second.

    function SelectedIndexChanged(accion, idnum) {
                var nuevaSelProyecto = "";
                var proyecto = "";
                var nombre = "";
                switch (idnum) {
                    case "ddlSelContrato": {
                        //var getValue = document.getElementById('ddlSelContrato').selectedOptions\[0\].value;
                        var e = document.getElementById("ddlSelContrato");
                        var getValue = e.options\[e.selectedIndex\].value;
                        nombre = "Contrato, indice seleccionado: " + getValue;
                    };
                        break;
                    case "ddlSelProyecto":
                        nombre = "Proyecto";
                        break;
                    case "ddlPtoStudio":
                        nombre = "Punto Estudio";
                    default:
                        nombre = "Defecto";
                        break;
                }
                alert("Alerta, indice: " + accion + " - " + nombre);
            }
    
        
    
    
    
                Contrato  
            
            @\*--------------------Listado desplegable de Contrato--------------------------\*@
            @Html.DropDownList("ddlSelContrato", new SelectList(ViewBag.SelContrato, "Id", "Nombre"), new { Class = "ddlStyle", onchange = "SelectedIndexChanged(this.value ,id)" })
        
        
    
        
    
                Proyecto  
            
            @\*--------------------Listado desplegable de Proyecto--------------------------\*@
            @Html.DropDownList("ddlSelProyecto", new SelectList(ViewBag.SelProyecto, "Id", "Nombre"), new { Class = "ddlStyle", onchange = "SelectedIndexChanged(this.value ,id)"})
        
    
        
    
                Punto de Medicion  
            
            @\*--------------------Listado desplegable de Puntos de estudio--------------------------\*@
            @Html.DropDownList("ddlPtoStudi
    
    Visual Studio javascript asp-net html question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups