how to write immediately search (c#)

廉价感情. 提交于 2019-12-08 04:05:12

问题


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?


回答1:


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.


来源:https://stackoverflow.com/questions/8113857/how-to-write-immediately-search-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!