Sometimes, we need to use pageLoad() function in both MasterPage and ContentPage to get something done. But, if we add two function with such same name, that function residing in ContentPage will be ignored by the browser. To correct this behaviour, we need to extend pageLoad() function in MasterPage as follows:
In MasterPage
function pageLoad(sender, args) { ... // ... do my MasterPage JavaScript stuff... ... if (window.contentPageLoad) { window.contentPageLoad(sender, args); } } |
In ContentPage
function contentPageLoad(sender, args) { // do something } |
Credit goes to devioblog.