Wednesday, November 4, 2009

Show Processing on Page using Modal Popup

Write the following code inside form tag and updatepanel.

< script type="text/javascript" language="javascript" >
// register for our events
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);

function beginRequest(sender, args)
{
// show the popup
$find('mdlPopup').show();
// if we are using this fanda in master page then
// $find(' < %=mdlPopup.ClientID% >').show();
}

function endRequest(sender, args)
{
// hide the popup
$find('mdlPopup').hide();
//WindowScroll();
// if we are using this fanda in master page then
// $find(' < %=mdlPopup.ClientID% >').show();
}
< /script >

//////////////////////////

< cc1:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="pnlPopup"
PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" >
< /cc1:ModalPopupExtender >

< asp:Panel ID="pnlPopup" runat="server" CssClass="updateProgress" style="display:none" >
< div align="center" class="ProgressBarCenter" >
< asp:Image ID="img" runat="server" ImageUrl="~/Images/simple.gif" / >
< span class="updateProgressMessage" > Loading ... < /span > < /div >
< /asp:Panel >

No comments: