ASP.NET MVC Filtering results in a list/grid

前端 未结 6 1873
我寻月下人不归
我寻月下人不归 2020-12-28 21:32

For some reason I\'m stuck on this. I need to filter results from a View based on a DropDownList in the same view. The basic idea is this: I have a list of providers that be

6条回答
  •  醉话见心
    2020-12-28 22:24

    There are many ways to skin this cat. Here's one.

    Enclose your DropDownList in a form with METHOD=GET.

    Then, in you controller, filter based on the value of provider that was passed in. Remember to treat it as a Nullable parameter so that you can have some kind of behavior when it's empty.

    Without posting some of your current code, it's tough to get much more specific than that.

提交回复
热议问题