Congratulations to MS for releasing yet another half tested software release in the shape of .NET 4.0. 2 days migrating an app from 3.5 and counting. Not sure why everything MS seems to be so painful these days but that's a story for another day:)
Anyway, as part of my painful experience, I thought I'd share a fix that works for me in the hope that it can save someone a few hours of time.
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
| <CdnSettings TelerikCdn="Disabled" />
| <asp:ScriptReference Name="MicrosoftAjax.js" Path="~/js/MicrosoftAjax.js" />
| <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="~/js/MicrosoftAjaxWebForms.js" />
The .js files that you need can be found in an earlier post.
Now for the really crap (i.e. hack to work around some unexplained RadScriptManger behaviour) bit essential to getting it to work:
Not only do you need files MicrosoftAjax.js
but you need to create copies of each of these file like this:
There are obviously errors in versioning between Telerik and MS .js libs. Also, I have no idea why RadScriptManager appends .debug. to files.
Obviously, this is a dirty hack and not a long term solution.
Here's another related little gem that's burnt several hours today.
Again, I hope someone benefits from my pain.
I compile a web application (using the .js files above) in the UK and deploy it on a server in the US.
WebResource.axd (generated by RadScriptManager with CombineScripts=true) causes .NET 4 to generate this error:
Specified argument was out of the range of valid values. Parameter name: utcDate
This error is generated because the .js files, on compilation into an installable .msi are time stamped with UK time (not sure if it's GMT or UTC or even BST). On installation onto the US server, the .js files have a date that is ~ 7 hours in the future.
.NET 4 doesn't like files with a future date so it barfs WebResource.axd (great huh?) More info here.
I'm trying ScriptManager and ToolKitScriptManager next.
More time spent fault finding others code. Telerik - can I at least have some points in my account please?
The System.ArgumentOutOfRangeException (file datetime) weirdness turns out to be a bug between MS Web Deployment Projects and Setup and Deployment resulting in file dates not being copied over to the installation MSI. As a work around, I'm having to set my UK dev machine to the same time zone as production server.
i.get_postBackElement() is undefined
This bug is present in all
.NET 4 builds that I've tried up to and including internal build 2010_1_526.
In summary, you can implement either (RadScriptManager + RadAjax) OR AjaxControlToolkit but not both.