开发者

Messagebox from MVC cntroller action

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜