views:

1294

answers:

3

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.

Thanks

A: 

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

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

AnthonyWJones
A: 

I have the Ajax working now but now (I didn't know it integrated the same).

However I can't get the form to submit when the text changes, I am trying to use JQuery to do this.

I am having to use a submit button and can only get the update records if submit is clicked.

dean nolan
have you tried jQuery's onchange event handler? It should attach to the text input. The script called from the handler will depend on how you want to update the page.
Frank Schwieterman
+2  A: 

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.

Orentet