Domanda

I have a query that takes a while to execute. The data is sent to the grid on the view and some filtering conditions may be sent from the view to the controller. I do not want to re-query the database during each filter. Is there a way to store the data loaded on the first query execution in some structure and later filter on that data? I was thinking in using something like ViewData or ViewBag but those seem not to last as long as might be needed in this case.

Or is there any other way of doing this that does not necessitate getting data from the database each time?

I am using ajax and not server binding because the of the query that takes a while. I want to be able to show the page even when the query is not done executing.

È stato utile?

Soluzione

You'll have to cache your data on the server somewhere, whether that's using ASP.NET output caching, an ASP.NET state server, or a 3rd-party caching solution (like memcached). Then when you do your AJAX queries you get the data out of your cache instead of your database.

Altri suggerimenti

Actually you can do it with viewModel and knockout.js

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top