asp.net - Cache user control -


The problem of output caching is to avoid reaching the object, it has been cached and will not be processed on ALL .

And this is an HTML, for example, what if I return to start drop down countries with specific selections If I want to post, I do not want to go back and rebuild the entire control and rebound in the collection of countries to make contol intermittent in a certain country.

Output caching will not solve the problem because it caches HTML, not the object, the object will be empty, I can not manipulate it.

Is it far to cache Output HTML instead of caching server object ?

If you do not think this is possible then please reply, so I know that this is impossible if many people say so.

Thanks

It is quite possible - just use the:

  httptime.chatch.ed ("mike", my code list);  

And then eject the object again:

  country list myCountryList = HttpRuntime.Cache ["myKey"] as the country; If (myCountryList == null) {// object is not in the cache}  

This is the most simple use - the cache is robust and supports some more complex behaviors such as invalidity, callback And so on. Which is included in the link given above.


Comments