开发者

Multiple field searches in MVC 3 using C #

Hi I am relatively new to MVC 3. i was just wondering if there is a way to do multiple field searches.

I'm looking to have many textboxes on a page, where the user can input search criteria such as Region, Salesperson Rating, Salesperson Subject, etc . and then when the user clicks the search button it should populate a list with Salespeople matching the criteria entered.

I have been looking 开发者_开发知识库on the web and i haven't found a concrete answer...

Thank you in advance...


You could use a grid like jqgrid to get these kinds of functionalities. It's relatively easy to implement in asp.net mvc. I once wrote a mvc helper for jqgrid, it's built for mvc2 but can also be used in mvc3 as well. There's also a sample app for the helper, you can find it here to see if fits your needs.


Yes, you can have multiple parameters passed to a controller action, e.g. by defining a form with multiple input fields in your view and let the form post to the action url. The data can be passed using multiple method parameters, a custom model class that defines the relevant properties, or simply by using a form collection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜