Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 asp.NET 的新手,我想根据下拉列表(产品类别)中选择的值在列表视图中显示产品列表。
我一直在寻找,但没有任何帮助!提前致谢!
您可以为此使用数据视图行过滤器:
String filterValue = drp.SelectedValue; DataTable dt = Your datatable; DataView dv = dt.DefaultView; dv.RowFilter = "product_category = '" + filterValue + "'"; lstView.DataSource = dv; lstView.DataBind();