...

View Full Version : javascript help



nihir
12-11-2009, 11:28 PM
I have this js function on modalpopupextender which has a button. when you click the button, it shows a progress bar on parent page, till it gets all the data, but not i want to hide that progress bar div when parent page reloads after getting data. I am not sure how to do that, and I need to do that on modal page, since there could be any number of parent pages with that modal. I have my sample code here, let me know
the window.parent function doesnot work.

<style type="text/css">
.loading {display:none; position:absolute; padding:5px; border:solid 1px #888888; background-color:#fff; width:93px; z-index:20001; filter:alpha(opacity=80); opacity:0.8;}
</style>
<asp:ImageButton ImageUrl="~/Images/ExcelIcon.gif" runat="server" ID="Excel" CausesValidation="false" style="cursor:hand;" />
<br />
<asp:Label ID="lblExportExcel" runat="server" SkinID="ToolBarIconLabel">Excel</asp:Label>

<script type="text/javascript">
function ShowProgress() {
document.getElementById("ind").style.display = "inline";

}
window.parent.onload = function() {
document.getElementById("ind").style.display = "none";
}
</script>

<!-- Pop Up Form -->
<div style="position: fixed; top: 0px; left: 0px;">
<asp:Panel ID="ExportExcelPanel" runat="server" SkinID="ModalPopUp_Panal" style="display:none">
<table class="ModalPopUp_Table" cellpadding="0" cellspacing="0" >
<tr>
<th colspan="2">
<asp:Panel ID="ExportExcelDragPanel" runat="server">Export Excel</asp:Panel>
</th>
</tr>
<tr><td style="text-align: right;">Description:</td><td><asp:TextBox ID="descriptionBox" runat="server" TextMode="MultiLine" Height="60" Width="300"></asp:TextBox></td></tr>

</table>
<asp:ValidationSummary ID="ValidationSummary_ExportPDF" SkinID="ModalPopUp_ValidationSummary" runat="server" ValidationGroup="ExportPDF"/>

<div class="BtnSumbit_Container">

<asp:Button ID="ExportExcelButton" runat="server" Text="Export Excel" OnClick="Excel_Click" CssClass="BtnSubmit" OnClientClick="ShowProgress();" UseSubmitBehavior="false" />
<asp:Button ID="CancelViewButton" runat="server" Text="Cancel" CssClass="BtnSubmit" />


</div>
</asp:Panel>
</div> <div class="loading" id="ind">Processing...</div>

<actk:ModalPopupExtender
ID="ExportExcelModalExtender"
runat="server"
SkinID="MPE_ReportFunction"
PopupControlID="ExportExcelPanel"
PopupDragHandleControlID="ExportExcelDragPanel"
TargetControlID="Excel"
CancelControlID="CancelViewButton"
OkControlID="ExportExcelButton"
Y="150"
>
</actk:ModalPopupExtender>

gusblake
12-12-2009, 12:55 AM
The parent of a popup is its 'opener'.


window.opener.onload = function() {
document.getElementById("ind").style.display = "none";
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum