Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: javascript help

  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript help

    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>

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    The parent of a popup is its 'opener'.

    Code:
    window.opener.onload = function() {
    document.getElementById("ind").style.display = "none";
    }
    Last edited by gusblake; 12-12-2009 at 12:53 AM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •