We are using the ToolkitScriptManager in a master page to include support for AJAX on all of our pages:
<ajaxToolkit:ToolkitScriptManager ID="_scriptManager" runat="server" CombineScripts="true" AllowCustomErrorsRedirect="false" ScriptMode="Release" EnableCdn="true" EnablePartialRendering="true" />
After activating the ASP.NET OutputCache though, we have been experiencing issues on some pages where the main AJAX script include and code blocks are missing as follows:
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="http://ajax.aspnetcdn.com/ajax/4.5/6/WebForms.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
window.WebForm_PostBackOptions||document.write('<script type="text/javascript" src="/WebResource.axd?d=SwCcMWJbC5HPR0GyMZBQBtBVcjnGUcMopW87tvl8Uit8R50NU80PEVSNB0QE3yO4evNmyWAgIDVYEBzwWxNOkQxLImY1&t=634896662120000000"><\/script>');//]]>
</script>
When these blocks are missing, we get JS errors when the page loads and when trying to submit the form because there are key AJAX objects that cannot be found.
Clearing the output cache fixes the pages temporarily and the above blocks of code are rendered correctly. However, it seems that some browsers are causing a different version of the page to be cached with these crucial AJAX blocks of code missing which then affects all other users accessing those pages.
Does anyone know what could be causing this and how we can force the AJAX code to be rendered for all browser types so that we can avoid crippled versions being cached for other users?