This is a migrated thread and some comments may be shown as answers.

radWindow opens pervious window

2 Answers 37 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 18 Sep 2013, 02:17 PM
I have a dashboard page I am making that has icons to the different pages on it.  What I am doing is using a radwindow with javscript to call all those pages via a icon.  the probme is that if they open one page do there thing then open a different one the pervious window will be there temporarily until the one they called opens.  How do I make sure this does not happen.  Also I have found that if a person stays in that window for about 20 seconds and does nothing the window locks up the code on the page, anbd i have to reload the radwindow to get it working properly agian.  Here is my part dashboard page code to get an idea what I am doing.  It seems when I put vaues for the radwinow in the html radwindow code it does not work so i have to put in javscript to get to work properly as well.

<table style="width:90%;margin-right:auto;margin-left:auto;margin-top:20px">
           <tr>
               <td style="height:20px;width:100%;border-bottom:double;border-color:red">iDRAT Management Options</td>
           </tr>
       </table>
       <table  style="width:90%;margin-right:auto;margin-left:auto;margin-top:20px">
           <tr>
               <td style="width:25%;align-content:center;vertical-align:top">
                   <asp:HyperLink ID="lnkAdmin" runat="server" onclick="LoadWindow(1)" ><asp:Image ID="imgAdmin" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Admin</asp:HyperLink>
               </td>
               <td style="width:25%;text-align:center">
                    <asp:HyperLink ID="lnkInventory" runat="server" onclick="LoadWindow(2)" ><asp:Image ID="imgtest" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Inventory</asp:HyperLink>
               </td>
               <td style="width:25%;text-align:center">
                    <asp:HyperLink ID="lnkEquiptypes" runat="server" onclick="LoadWindow(3)" ><asp:Image ID="Image1" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Equipment Types</asp:HyperLink>
               </td>
               <td style="width:25%;text-align:center">
                    <asp:HyperLink ID="lnkPo" runat="server" onclick="LoadWindow(4)" ><asp:Image ID="Image2" runat="server" ImageUrl="~/Images/AdminIcon2.png" /> Manage Purchase Orders</asp:HyperLink>
               </td>
           </tr>
       </table>


The following is my Javascript to go with it.

<script type="text/javascript">
        function LoadWindow(Type) {
            
                var radWidow = $find("<%= RadWindow.ClientID%>");
                if (Type == 1) {
                    radWidow.show();
                    radWidow.setUrl("ManageAdmins.aspx");
                    radWidow.maximize();
                }
                else if (Type == 2) {
                    radWidow.show();
                    radWidow.setUrl("ManageEquip.aspx");
                    radWidow.maximize();
                }
                else if (Type == 3) {
                    radWidow.show();
                    radWidow.setUrl("ManageDb.aspx");
                    radWidow.maximize();
                }
                else if (Type == 4) {
                    radWidow.show();
                    radWidow.setUrl("ManagePO.aspx");
                    radWidow.maximize();
                }
                else if (Type == 5) {
                    radWidow.show();
                    radWidow.setUrl("ReceiveItems.aspx");
                    radWidow.maximize();
                }
                else if (Type == 6) {
                    radWidow.show();
                    radWidow.setUrl("IssueItem.aspx");
                    radWidow.maximize();
                }
                else if (Type == 7) {
                    radWidow.show();
                    radWidow.setUrl("Transaction.aspx?Tran=5");
                    radWidow.maximize();
                }
                else if (Type == 8) {
                    radWidow.show();
                    radWidow.setUrl("Transaction.aspx?Tran=24");
                    radWidow.maximize();
                }
        }
   </script>

 

 

 

 

                    

 

 

 

 





2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 19 Sep 2013, 07:17 AM
Hi Kevin,

Here is what I would advise:
- change the ID of the RadWIidow to, for example, RadWindow1 so that it is different than the name of theRadWindow class
- set its ShowContentDuringLoad property to false. This will have it show a loading sign while each page loads completely so that old content cannot be seen while the next page is being loaded. It is better if this property is set in the markup rather than with JavaScript
- I would put the calls to show() and maximize() out of the if blocks, right after the reference is obtained. I would also first add a check for the object, like if(radWidow) { the rest of the code }
- on the "lockup" - this is not behavior that has been reported for, and I do not see how it can be related to the RadWindow control. It merely loads the designated page in an iframe, so the issue is most likely with some timers/postbacks/other custom logic in the concrete page. If loading it in a simple iframe shows different behavior I would advise sending us a sample that shows the problem so we can examine the problem.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Kevin
Top achievements
Rank 1
answered on 19 Sep 2013, 03:17 PM
Marin,

OK way better performance than it had before, thanks for the help and information.
Tags
Window
Asked by
Kevin
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or