I have a SharePoint app that is configured correctly in the web.config for asp.net ajax, but when I try to use the Sys class it says it's undefined. I have installed SP2 and know that ajax is enabled because update panels work correctly. ScriptManager is being loaded to the page. I have a script link to register the external js file, and have confirmed that the url is correct. But I am using "_spBodyOnLoadFunctionNames.push(functionName())" to call the function that throws the error. Any help on this is greatly appreciated since all I come up with on google is how to integrate ajax into sharepoint.
JavaScript
_spBodyOnLoadFunctionNames.push(InitializeDynamicLoadingPanel());
function InitializeDynamicLoadingPanel() {
modalLayerID = '';
prm = Sys.WebForms.PageRequestManager.getInstance();
IsAsyncPostBack = prm.get_isInAsyncPostBack();
if (!IsAsyncPostBack) {
prm.add_initializeRequest(InitializeRequestHandler);
prm.add_beginRequest(BeginRequestHandler);
prm.add_pageLoading(PageLoadingHandler);
prm.add_pageLoaded(PageLoadedHandler);
prm.add_endRequest(EndRequestHandler);
}
}
C#
ScriptLink.Register(page, "dynamicLoadingPanel.js", false);