I have created a paging grid in asp.net with this jquery plugin(https://github.com/gbirke/jquery_pagination),that work fine.But I do not kown how to do search. I am a newbie.Thank you very much!
I have created a paging grid in asp.net with this jquery plugin(https://github.com/gbirke/jquery_pagination),that work fine.But
Share
Let’s ignore jQuery for now and assume that you’d implement search entirely in .NET, presumaly in response to a GET request with a querystring parameter called “
q“.How you actually perform the search isn’t relevant: I assume you have some kind of database object or Lucene index searcher that provides you with the result, then it’s just a matter of paging the results of that data with optionally provided paging querystring parameters (usually called
startandcount) respectively.e.g. (in MVC parlance)
Now then, when you get jQuery involved I assume you want to do the search asynchronously. Then it’s just a matter of re-implementing the server-side
Searchaction, but return JSON, XML, or a raw HTML fragment instead of an entire view document.Presumably you’d execute an event-handler for the keypress event of a Textbox (detect the Enter/Return key), fire off the Ajax request to the Search controller action, then convert the response into HTML (if it isn’t already) then insert it into your result table. Simples.
Further technical details are omitted for various reasons.