Hi,
I am not exactly sure what's causing the problem. However JavaScript rendered inside CallbackPanel runs in a local scope instead of global scope, so that may cause some problem for you. In another word:
is not visible on the global scope. So when some other code in the global scope attempts to check the value of variable "print", it won't see anything.
I believe if you define the variable globally first before the callback, the code will effectively modified the global version, otherwise it will create its own local version and go out of scope as soon as the script block finishes. Thus that could be a workaround for you.
You may also want to take a look of ASP.NET UpdatePanel. They work in a very similar way but they appear to run the JavaScript in global scope. It's only available for ASP.NET 2.0 and above, though.
Thanks