Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Cara memfilter nilai daftar dropdown dengan daftar dropdown lain di ASP.NET, c #

lihat tautan berikut untuk mengisi daftar drop-down berjenjang.

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDrop... .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 di belakang yang dilindungi void Page_Load(pengirim objek, EventArgs e){if (!IsPostBack){// kode Anda untuk mengikat drop downlist pertama

        }
    }

    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. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Menggunakan Kursor dalam Loop dari prosedur tersimpan

  2. MySql KIRI GABUNG dengan COUNT

  3. Tidak dapat terhubung ke database mysql?

  4. Cara terbaik untuk menyimpan dan mengambil sinonim di database mysql

  5. Bisakah Anda menambahkan pernyataan if di ORDER BY?