Thursday, 23 June 2011

Telerik, IE9 and a Schoolboy error

As part of a project I am working on I have been using the rather fantastic Telerik ASP.NET Ajax controls and despite the documentation being a little bit lacking have managed to get things working very smoothly.

But today I noticed a JavaScript error appearing on one of my pages which seemed to relate directly to the Telerik controls (Unable to set value of the property 'control': object is null or undefined) - I did a search on the forums and found several people with the same problem such as this one but none of the solutions seemed to apply in my case.

Just as a side note the JavaScript error was picked up by one of my colleagues and I struggled to reproduce the problem on my own machine - I eventually tracked the problem down to IE9 and the fact it now hides the error icon in the status bar so I never caught it myself, kudos to Microsoft for that little gem and wasting a load of my time.

Anyway, I decided the best way to solve the problem was just to keep deleting things from the page until the error went away which eventually led me to a bunch of controls which I had commented out. And here is where I have to admit that I made a bit of a schoolboy error because I had used a standard HTML comment <!-- --> which meant that ASP.NET still rendered the control and its JavaScript but hides the HTML and hence generates the rather cryptic error message. So Lesson learnt, when commenting out controls use <%-- --%> instead.

No comments:

Post a Comment