Hi To all,

I am new to this site, and looking for any support you can give to me about my concern.

I want to know how can I call the java script function of show and hide progress bar image when needed.

I want to display the progress bar image running and doing some server side task like search and save, and then, after the task, i will hide the progress bar image right away.

This is my aspx

<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Inside Update Panel"
onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>

<script type="text/javascript" language="javascript">
var ModalProgress = '<%= ModalProgress.ClientID %>';
</script>
<div>
<script src="Script/UpdatePanelProgress.js" type="text/javascript"></script>

<asp:Panel ID="panelUpdateProgress" runat="server" >
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter ="0">
<ProgressTemplate>
<img src="App_Themes/Themes/progressor.gif" style="vertical-align: middle" alt="Processing" />
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Panel>

<cc1:ModalPopupExtender ID="ModalProgress" runat="server" BackgroundCssClass ="modalBackground"
TargetControlID ="panelUpdateProgress" PopupControlID ="panelUpdateProgress">
</cc1:ModalPopupExtender>
</div>
</form>
</body>


Here is the javascript attached on the aspx
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginReq);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endReq);

function beginReq(sender, args)
{
$find(ModalProgress).show();
}

function endReq(sender, args)
{
$find(ModalProgress).hide();
}


here is my server side

protected void Button1_Click(object sender, EventArgs e)
{
I want to call the beginReq js - How?
I will do some searching .net script here
After the search, I want to call the endReq js - How?
}


Thanks and appreciate your help