sql >> Databasteknik >  >> RDS >> Mysql

Hur man filtrerar rullgardinsvärden efter en annan rullgardinslista i ASP.NET, c#

kolla in följande länkar för att fylla i den överlappande rullgardinsmenyn.

http://www.asp.net/ajaxLibrary/AjaxCampleDropDropDownTool/AjaxCampleDropDown .aspx

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

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

Kod:

<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>

// Code behindprotected void Page_Load(objektavsändare, EventArgs e){if (!IsPostBack){// din kod för att binda den första rullgardinsmenyn

        }
    }

    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. MySQL Connector/python fungerar inte i django

  2. SQL Server, kan du inte infoga null i primärnyckelfältet?

  3. distinkt antal (*)

  4. UTF-8 MySQL och Charset