aliyaho
aliyaho

Reputation: 41

how to write immediately search (c#)

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?

Upvotes: 1

Views: 507

Answers (1)

agarcian
agarcian

Reputation: 3963

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.

Upvotes: 3

Related Questions