Background
When a client-side button click triggers a server-side function, a loading panel (div) is displayed before the server-side function is executed. The loading panel should be removed once the server-side function completes.
My Approach
Upon completion of the server-side function, I plan to invoke a JavaScript function that will remove the div element. To test this, I am currently using an alert script from the master page.
Client-Side Code
Implementation of my PopUp Function:
<script>
function PopUp() {
debugger;
alert('TEST');
}
</script>
Script Manager:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
Server-Side Code
Code to call after completion of server-side functions:
//Add the script after <form> tag
bool isClientScriptBlockRegistered = ClientScript.IsClientScriptBlockRegistered("ShowStatus");
if (!isClientScriptBlockRegistered)
{
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ShowStatus", "PopUp();", true);
}
Issue
The server is not executing my script, and the alert window is not being displayed. The script works on any page other than the master page.
Queries
Am I overlooking something?
Do I need a callback or page refresh for the alert to show, or can the server trigger the script without any client interaction?