I am new to the MVC so excuse me for asking this basic question. My requirement is simple, I have got a view where user can开发者_JS百科 provide the search criteria and then clicks the 'Search' button. If no matching records found for the entered search criteria then I need to show a message box to the user and stay at the same view.
How to do this?
Your Search
action method can pass an IEnumerable<T>
into the corresponding view. If the model's Count()
method returns zero, you can display a message box; otherwise, you display the search results.
Sounds like AJAX is the way to go, but without specifics regarding language or framework it's hard to say more.
精彩评论