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. :)

JK.
  • 21,477
  • 35
  • 135
  • 214
  • You should split this into multiple questions. Your asking for half a book here. – John Farrell Apr 29 '10 at 01:18
  • 1
    Fine whatever. I'm more interested in the main question: what is the best approach - A, B or C. Questions on how to implement can come later. – JK. Apr 29 '10 at 20:22
  • see this example: http://stackoverflow.com/questions/8541821/how-to-simplify-my-statefull-interlaced-modal-dialogs-in-asp-net-mvc –  Sep 10 '12 at 18:43

1 Answers1

0

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:

How to implement search features in ASP.NET MVC applications

Community
  • 1
  • 1
Jack
  • 9,156
  • 4
  • 50
  • 75