However, when I load the domo page in browser, I get this error:
After looking through the stack trace of the error, something comes to my attention:
It seems that RegisterCssReferences tries to inject some style information into the <head> section and throws the error because there are some code blocks in the <head> section. This really puzzles me because there is no CssClass or any style defined on neither of the AJAX CalendarExtender controls, why in the world RegisterCssReferences is called?
Let’s take a deep look at AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences function with Red Gate’s .NET Reflector. At the very end of the function, there is a block of code like this:
Apparently, RegisterCssReference uses a hidden field called "__AjaxControlToolkitCalendarCssLoaded" to see if it needs to call RegisterClienctScriptBlock. The name of the hidden seems to tell us that it only happens with AJAX CalendarExtender, and it seems to explain why I never had problem before with other AJAX controls (or maybe I should say I haven’t had the same problem with other AJAX controls that I have used). It seems to be a bug to me, what do you think?
1. Replace all code blocks with the actual control ID (in this case)