Skip to content

Instantly share code, notes, and snippets.

@JakubLinhart
Created April 24, 2012 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakubLinhart/2482550 to your computer and use it in GitHub Desktop.
Save JakubLinhart/2482550 to your computer and use it in GitHub Desktop.
Script registration labyrinth – startup scripts and $find (alternative)
Sys.Application.add_init(function () {
setTimeout(function () {
alert($find('Control1'));
}, 0);
});
string script = string.Format("alert($find('{0}'));", Control1.ClientID);
AjaxManager1.ResponseScripts.Add(script);
setTimeout(function(){alert($find('Control1'));}, 0);
(function () {
var fn = function () {
var control = $find('someControl');
control.doSomething();
Sys.Application.remove_load(fn);
};
Sys.Application.add_load(fn);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment