What I’m curious about, is I have a site (ASP.NET), which will display some search results. What I would like to do is load the page with search results, then have the client query my SQL database to check and see if any of the search results have been “Favorited” by the user. I know a little bit about JSON, SOAP, and HTTP Requests, but the only way that I know how to do this right now would be to create a page in my project that I could request from each returned result, and have that page validate the user from the cookie, query sql for the answer, and finally return a true or false to the client on whether to hide or show the “Favorite” icon.
A simple example of this (from everything I can tell) would be the Queue(_) count on Hulu. When I load the Hulu site, it has “Queue“, then about 1 second later, it retrieves the actual count, and I get “Queue(1)“
Can anyone explain the proper way to do something like this?
Thanks in advance!
Note: Any links would be greatly appreciated, I’ve been googling and reading, but just haven’t found the right resources yet.
There are many ways that you could go about doing this. One of the more simple ways would be to use a PageMethod on the current page that you are on, and have an Async operation that calls the method to get the result(s).
Here is a quick overview of a PageMethod, it uses a contact form, but you get the general idea.