问题
I'd like to know if there's a special way of implementing output caching and using a control from the ajax control toolkit. I keep getting a javascript error on a page with output caching and a tab control that says: ajaxtoolkit (my assembly prefix) is undefined.
This is the directive I added:
<%@ OutputCache Duration="3600" VaryByParam="none" %>
回答1:
Microsoft does not support output caching in combination with ScriptControls, Extenders, or ScriptManagerProxies that need ScriptReferences. A workaround to the issue is to include the script references these resources require on the main script manager, outside the output cached control.
More info here
回答2:
Since the output caching cannot be combined with the generated scripts by the AJAX framework yet (hopefully in a future version some similar behavior will be available crossing fingers), other type of optimization approach has to be made like replacing the ScriptManager for the ToolScriptManager.
http://blog.creonfx.com/performance/howto-optimize-rendering-speed-of-aspnet-ajax-websites
来源:https://stackoverflow.com/questions/664107/asp-net-output-caching-and-ajax-control-toolkit