views:

304

answers:

1

I have a view with a textbox and a search button, eg CustomerTextBox and CustomerSearchButton.

The list of customers is too long to display in a dropdown, and there has to be advanced search functions anyway.

What is the best practice in MVC to handle this case? When the user clicks on the search button, should it:

A. Load another view into a modal popup (eg /customers/search)?

B. Have the search form in a hidden div that expands when the search button is clicked?

C. Redirect the user to a search page by means of RedirectTo("/customers/search")?

I've only been doing MVC for 3 days so thanks to those who answer my questions that might have quite obvious answers that I cant see yet. :)

A: 

I think it's really up to you, what would fit your site better? If you need some advanced searching capabilities, create a /customers/search and redirect to it. If its somewhat simple and quick, use a modal popup, or expand a hidden div with a search field or two when clicking the button.

Check this out:

http://stackoverflow.com/questions/563308/how-to-implement-search-features-in-asp-net-mvc-applications

Jack