Question

I am looking to implement a live search in my MVC app similar to this site when you type in a question and results come up that are similar or like the search on http://www.krop.com/

I have the search code all working and results updated. I just need to know how to add the AJAX to the MVC framework (I know this site was built using it) so that when I type the results are updated.

I had this all working in normal ASP.NET Forms app.

Was it helpful?

Solution

what you need to do it attach to Jquery onchage event handler, and then call some ajax method of jquery ($.load , $.ajax etc...) and the information from a specified controller. asp.net mvc controller can return json results so you can later manipulate it in your javascript code.

if you have any other questions go ahead and ask.

OTHER TIPS

An ASP.NET MVC site will have AJAX and JQuery available by default.

Mike Bosch's Blog can give you some pointers on this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top