Sunday, March 11, 2012

ModalPopup Client-Side Reference

Try adding a handler to the Sys.Application.Load event, and adding your shown handler there. Application.Load occurs later in the client page lifecycle.

Hi,

The framework components are not yet initialized immediately after window.onload .

Put your script inside a function called pageLoad to have access to the MS AJAX Framework components immediately after the page is rendered.

Ex:

<scriptlanguage="javascript">function pageLoad(){

alert(

'Framework Components Intialized');

}

</

script>

Hope this helps .


Yeah! That works a treat, thanks. I now just do : Sys.Application.add_load(jsBindToModal);

Thanks to Phanatic for the tip on pageLoad() too - however the prob with that is that I may have multiple controls trying to override pageLoad() for their own purposes, which wouldn't work as only the last one defined would run. I needed to be able to add multiple handlers.

No comments:

Post a Comment