This is a migrated thread and some comments may be shown as answers.
directing page loading with radwindow
1 Answer 14 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Leonard asked on 15 Dec 2011, 03:06 AM


I have inherited an project that relies heavily on the Telerik library.  In the current application, there are two menu items that when clicked generate a redirect to the same asp page, but with different arguments:

So I have been asked to replace them with a dialog box that allows the user to choose the Mode and type, then opening the page.  In looking at the Telerik controls that are available to me, it seems that the RadWindow is perfect.  My strategy is:
redirect to the generic page:
Define a RadWindow on the page and sets its VisibleOnPageLoad to true.

The RadWindows contains a Cancel button and a Next button.  Selection of the cancel button closes the dialog and leaves an empty page.  Selection of the Next button will redirect to the same page but contain the Mode and Type parameters using the
 window.location = myasppage.aspx?Mode="whatever"&Type="whatever";

My problem is that because VisibleOnPageLoad=true the radwindow always opens so  I can't load the real page! 

Am I going about this correctly? Is there another control to deal with this? 

I was thinking that I could set VisibleOnPageLoad to false, then check for my parameters in the OnPreInit method to decide if I should show the radwindow. 

I haven't been able to figure out how to call a javascript function (to show the radwindow) from the code behind, and even if I could, I'm not sure that the javascript would even be loaded yet!

Is there a better way of doing this?  Will this even work?


1 Answer, 1 is accepted

Sort by
Marin Bratanov
Telerik team
answered on 16 Dec 2011, 05:27 PM
Hello Leonard,

I believe checking for the presence of these parameters in the querystring is a good approach to determining whether you should show the RadWindow. What I can suggest is that you open it from the server by using the approach from the following sticky thread: Please note the utilization of the Sys.Application.Load event which guarantees that all necessary scripts are loaded on the page before trying to show the RadWindow.

Best wishes,
the Telerik team
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 their blog feed now
Asked by
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question