Page loads multiple times in Rad Window

In Previous article, i have discussed the multiple times firing of telerik Rad Window and its solution at code side. (C#)

In this article i will provide solution of same problem in Javascript style. 🙂

How to set the problem of loading popup three time…

  1. Any page must have only one RadWindowManager, if have more than one manager then usually it sets the setting of first manager…. Ambiguity
  2. ReloadOnShow must be false. Instead of this use below technique.

Create a random javascript number and send as a URl parameter while opening from client side, in this way, it will ensure to load page with reload option. And therefore no need of this flag.

I have found that if the Reload is turned on, it will hit the window page twice for some reason (not desired).  If you turn the Reload off though, it will never show the updated page if you are reusing the same window.  So far, what seems to work best is to add a random number into the url so the window does not use a cached version (see below).  It will only hit the page once, and will also actually display the new page.

Client side code:

// Need a random item in the querystring so the RadWindow does not pull from cache.
var WinId = "Win" + Math.random().toString();
var Url = "query_preview.aspx?id=" + elReportSavedQueryID.value + "&wid=" + WinId;
var oManager = GetRadWindowManager();
var oWnd = oManager.GetWindowByName("ExportPreviewWindow");
  if (!oWnd){
   alert("No window object found!");
   return;
  }
oWnd.SetUrl(Url);
oWnd.Show();

Window Manager in Page:

<radw:radwindowmanager id="RadWindowManager1" runat="server" left="" navigateurl=""  skinspath="~/RadControls/Window/Skins" title="" top="">
  <Windows>
  <radW:RadWindow ID="ExportPreviewWindow" DestroyOnClose="false" Modal="true"EnableViewState="False"    VisibleStatusbar="true" Width="600px" Height="400px" NavigateUrl="" />
  </Windows>
</radw:radwindowmanager>

Find all possible solution at this URL

Posted

in

by


Related Posts

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading