Some background. The project is a VS 2005 Web Application using ASP.NET AJAX Extensions 1.0.
Question, How can I reference the JavaScript files that are used by the Scriptmanager control, without using the ScriptManager control or how can I load the ScriptManager JS files earlier (I don't think this is possible as the ScriptManager has to be in the server-side form tag)?
I have a ScriptManager control in a master page, but a lot of times, there are pages that are just good ol' non-async postbacks and I create client-side objects before the script manager has loaded. Now I know it's good practice to load scripts near the end of the markup and CSS at the start, but in my case, some of the scripts I create need to be before, typically in the head tag because for example I'll have a repeater that instantiates a client-side object.
So this is what I'd like:
// My scripts
Right now this is what I do to get around the issue:
(function() {
var myInterval;
myInterval = setInterval(function() {
if (!Type) {
return;
}
clearInterval(myInterval);
Type.registerNamespace("Awesome");
Awesome.Widget = function() {
var _this = this;
this.myProperty = 'This is awesome';
}
}, 40);
})();
or I do this:
var Awesome = {};
Awesome.Widget = function {
/// Awesome code.
}
As well it would be nice to not load these scripts twice as the ScriptManager control will render at some point since it's in my MasterPage.
Maybe the problem is I'm going about this the wrong way. Any help is greatly appreciated.