I'm trying to show/hide a loading panel based on what control made the request. My javascript is as follows:
However, when I click the "btnRefresh_SpendingStatus" button, I get the following error: "Object doesn't support this property or method". Am I missing something? Thanks.
var
objLoadingPanel =
""
;
var
objPageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
objPageRequestManager.add_initializeRequest(RequestInitializing);
objPageRequestManager.add_endRequest(RequestEnding);
function
RequestInitializing(sender, eventArgs) {
objLoadingPanel = $find(
"<%=lpLoadingPanel.ClientID%>"
);
if
(eventArgs.get_eventTarget() ==
"<%=btnRefresh_SpendingStatus.ClientID%>"
) objUpdatedControl =
"<%=lblChart_Status.ClientID%>"
;
//show the loading panel over the updated control
objLoadingPanel.show(objUpdatedControl);
//objLoadingPanel.show("<%=lblChart_Status.ClientID%>");
}
function
RequestEnding(sender, eventArgs) {
if
(objLoadingPanel) objLoadingPanel.hide(objUpdatedControl);
objUpdatedControl =
null
;
objLoadingPanel =
null
;
}
However, when I click the "btnRefresh_SpendingStatus" button, I get the following error: "Object doesn't support this property or method". Am I missing something? Thanks.