Get values from a DropDownList

1

As I can get the value of a DropDownList in the controller, it is assumed that there is a DropDownList which when selecting an option and pressing search should filter and throw the data in the table below in that same view, I am working on the following way Is it the right way or am I wrong?

View:

Driver:

    
asked by Luis Ruiz Martínez 11.11.2016 в 06:20
source

1 answer

1

You are correct, from the DropDownList you can get the value and after that you can do the filter by pressing a button, or you can add the attribute AutoPostBack="true" to the DropDownList control and add the event OnSelectedIndexChanged . You have two ways to do it, both return the selected value.

DropDownList.SelectedValue; 
DropDownList.SelectedItem.Value;

Here I leave the help of MSDN, here comes everything you need to know about the control DropDownList

    
answered by 11.11.2016 / 17:06
source