Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I want to search records from dropdown list using asp.net I have created fields with name, ownerdepartment, status, createdon and createdby. dropdown lists are department and createdby. Now in dropdown list if I select information technology it should display data related to information technology. Please kindly help me to do. Below is the html.

ASP.NET
<tr>
       <td style="width:120px;text-align:top" class="blue">OwnerDepartment:</td>
        <td class="auto-style9"><asp:DropDownList ID="ddlOwnerDepartment" runat="server"
            onselectedindexchanged="DropDownList_SelectedIndexChanged" >
                                                 </asp:DropDownList>
                         </td>
    </tr>



and below is the view code in aspx.vb
VB.NET
Private Sub DropDownList_SelectedIndexChanged(sender As Object, e As EventArgs)
    ddlOwnerDepartment.SelectedValue = DropdownList.SelectedItem.Value
End Sub



Thanks in advance!!
Posted
Comments
Sinisa Hajnal 15-Dec-15 3:13am    
In selected index changed use the value to filter list datasource by the field. Then rebind. There are also properties that enable you to filter the gridView if you use it. Google for a bit, you'll find plenty of solutions, some are client side only, some are server side rebinding. Good luck.

1 solution

Below listed links may help you


Dropdown list [^]

Binding and searching[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900