ASP.NET MVC search box: use modal popup or inline div or redirect to another page?

Posted by JK on Stack Overflow See other posts from Stack Overflow or by JK
Published on 2010-04-28T22:40:31Z Indexed on 2010/04/28 22:47 UTC
Read the original article Hit count: 902

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)? How would you do this in MVC, just set popupWindow.location.href = '/customers/search'? How would you return the value to the main view?

B. Have the search form in a hidden div that expands when the search button is clicked? How would be done? a partial view maybe?

C. Redirect the user to a search page by means of RedirectTo("/customers/search")? How would you return the value to the main class?

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

© Stack Overflow or respective owner

Related posts about asp.net-mvc2

Related posts about modal-dialog