1

I'm using visual web developer to create basic gui with one table DB. I'm trying to make something like google instant search. I have a search page that contains one textbox, one button, and gridview. I'm entering a string in the textbox, pressing the button and getting the results in the gridview.

I'm trying to use the textchanged event of the textbox and allow autopostback but still the search isn't working as I want.

What am I missing and how can I create the search as showed above?

Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
aliyaho
  • 41
  • 2
  • You'll need a lot of great [Ajax](http://en.wikipedia.org/wiki/Ajax_(programming)) to do something like that. So if you don't know about Ajax, learn that first. – Ry- Nov 13 '11 at 19:00
  • 3
    Please elaborate in as much detail as possible what you mean by "not working." – Matt Ball Nov 13 '11 at 19:01
  • i mean that i need to press to button to active the search instead of the search will be active by the textchanged event, there isnt simplest way to write this?(without ajax :S) – aliyaho Nov 13 '11 at 19:33

1 Answers1

3

We implemented a Google Instant type of search using the following:

  1. TypeWatch Plugin: The TypeWatch plugin raises an event x milliseconds after the user stops typing in the text box. Can be configured to activate after a number of characters have been typed.
  2. A server-side Search function: Implement your search and expose it in a url in your site so you can submit searches and return json objects with the result.
  3. An Ajax call: When the typewatch event is raised, make the ajax call to the Search endpoint, and render the results.
agarcian
  • 3,909
  • 3
  • 33
  • 55