sql >> Database teknologi >  >> RDS >> Mysql

Sådan filtreres dropdown-listeværdier efter en anden dropdown-liste i ASP.NET, c#

tjek følgende links for at udfylde rullegardinlisten.

http://www.asp.net/ajaxLibrary/AjaxCampleDropDropDownDown/CascadingDropDown. .aspx

http://www.codeproject.com/KB/aspnet/CascadingDropDown.aspx

http://www.aspsnippets.com/Articles /Creating-Cascading-DropDownLists-in-ASP.Net.aspx

Kode:

<table>
    <tr>
        <td>First</td>
        <td><asp:DropDownList ID="DDLFirst" runat="server"  AutoPostBack="true"
                onselectedindexchanged="DDLFirst_SelectedIndexChanged"></asp:DropDownList></td>
    </tr>
    <tr>
        <td>Secord</td>
        <td><asp:DropDownList ID="DDLSecond" runat="server" AutoPostBack="true"
                onselectedindexchanged="DDLSecond_SelectedIndexChanged">
            <asp:ListItem Text="Select" Value="Select"></asp:ListItem>    
            </asp:DropDownList></td>
    </tr>
    <tr>
        <td>Thrid</td>
        <td><asp:DropDownList ID="DDLThird" runat="server"><asp:ListItem Text="Select" Value="Select"></asp:ListItem>    </asp:DropDownList></td>
    </tr>
</table>

// Kode bag beskyttet void Page_Load(objekt afsender, EventArgs e){if (!IsPostBack){// din kode til at binde den første drop downliste

        }
    }

    protected void DDLFirst_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DDLFirst.SelectedIndex > 0)
        {
            string FirstDDLValue = DDLFirst.SelectedItem.Value;
            // below your code to get the second drop down list value filtered on first selection


        }

    }

    protected void DDLSecond_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DDLSecond.SelectedIndex > 0)
        {
            string SecondDDLValue = DDLSecond.SelectedItem.Value;
            // below your code to get the third drop down list value filtered on Second selection


        }
    }


  1. egenskaben "diesel::Expression" er ikke implementeret for "bigdecimal::BigDecimal"

  2. PHP mysql søg i flere tabeller ved hjælp af et nøgleord

  3. listunagg funktion?

  4. Android:Hvordan importerer man kontakt fra telefonen?