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

RadWindow in server side

7 Answers 339 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bogice
Top achievements
Rank 1
Bogice asked on 25 Mar 2010, 08:42 PM
Hi ,
I have a RawindowManager in MasterPage
a Radwindow in it's Windows collection
In the content page, i have an imagebutton.
I want to open the rad window in server side.
So i added this into imagebutton handle:
//doing some server side stuff here.
RadWindowManager 
man = (RadWindowManager)Master.FindControl("WindowsManager"); 
        RadWindow win = new RadWindow(); 
        win.NavigateUrl = "path"
        win.VisibleTitlebar = true
        win.VisibleOnPageLoad = true
        man.Windows.Add(win); 
running without any error but the radwindow is not open. What am i missing?
This is the post continues with the one i made in the support ticket. However, there is no reply or post back option in the thread so i could not post over there.
Thank you
This button is placed inside a RadPageView. Also the content page uses RadAjaxmanagerProxy

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Mar 2010, 03:14 PM

Hi,

I am not sure about why your code didn't work. But can you try using RegsterStartupScript to invoke client method and open the window from client side as described in the following forum?

Opening rad window

Thanks,

Princy.

0
Bogice
Top achievements
Rank 1
answered on 26 Mar 2010, 03:35 PM
Hi Princy,
Yes, i can open radwindow using  client-side script. However i want to do some server-side work, that's why i am using this approach. Must be something block radwindow to open.
Thank you
0
Georgi Tunev
Telerik team
answered on 29 Mar 2010, 06:07 AM
Hi Bogice,

As Princy said, your code looks OK (I would only suggest to set the ID property as well) so the problem might be somewhere else in the logic that you are currently using. Please open a support ticket and send a small sample project  that reproduces your setup so we could check it.

Sincerely yours,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Free Developer
Top achievements
Rank 1
answered on 30 Mar 2010, 10:46 PM
I believe that the only way to open the RadWindow is from JavaScript...
It doesn't matter if you set the newWindow.VisibleOnPageLoad = true;
Also read this It is very important: http://www.asp.net/Ajax/Documentation/Live/ClientReference/Sys/ApplicationClass/SysApplicationLoadEvent.aspx
 http://www.telerik.com/community/forums/aspnet-ajax/window/want-to-pop-up-window-from-server-side.aspx#791040
try this:

RadWindow newWindow = new RadWindow(); 
newWindow.ID = "window1"
newWindow.NavigateUrl = Request.ApplicationPath + @"/Test01.aspx"
newWindow.VisibleOnPageLoad = true
newWindow.Modal = true
newWindow.AutoSize = true
RadWindowManager1.Windows.Add(newWindow); 
         
string Myscript = ""
Myscript += "<script language='javascript' type='text/javascript'>"
Myscript += "Sys.Application.add_load(ShowWindow);"
Myscript += "function ShowWindow()"
Myscript += "{"
Myscript += "   window.radopen(null, 'window1');"
Myscript += "}"

0
Accepted
Georgi Tunev
Telerik team
answered on 31 Mar 2010, 06:48 AM
Hi Free Developer,

Yes, RadWindow can be opened via its client-side API, however it can be opened from the server with VisibleOnPageLoad as well. If this doesn't happen on your side, there must be a problem with the logic that is currently used, so I suggest to open a support ticket and to send me a setup where the problem can be reproduced. I will check it and get back to you with the solution.

Kind regards,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Bogice
Top achievements
Rank 1
answered on 31 Mar 2010, 03:52 PM
Hi,
Thank you all  for your replies. For now, i just go with the client side appoarch, because actually what i need is the selected value in a dropdown, which can achieve through client side. In the future, i would re-post the problem if i need to do something else that must be done on server-side. The server side example work well and i presume my problem came from logic.
Best regards
0
James Wofford
Top achievements
Rank 1
answered on 29 Nov 2010, 10:27 PM
I know this is an older post... but, figured I would pipe in on it...
The code should be fine... The problem most likely is that the RadWindowManager is not  able to perform ajaxified actions via the image button you are using to open the window from the server side. 

I am making two assumptions:
  1. You have a RadAjaxManager on your master page.
  2. You have everything on the aspx page wrapped in a RadAjaxLoadingPanel.

I experienced similiar symptoms in a situation that is very similiar...  This is what I did to fix it.

Then in the Page_Load:
(Bare with me... this is from memory, and use your control ids of course...)

RadWindowManager radWindowManager = this.Master.FindControl("RadWindowManager1") as RadWindowManager;
RadAjaManagerProxy1.AjaxSettings.Add(radWindowManager, this.imgButton);

This should ajaxify the RadWindowManager on the masterpage with the imgButton on your current page, allowing the RadWindow to open when you set the VisibleOnPageLoad property to true and add it to the window manager.

~james

Tags
Window
Asked by
Bogice
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Bogice
Top achievements
Rank 1
Georgi Tunev
Telerik team
Free Developer
Top achievements
Rank 1
James Wofford
Top achievements
Rank 1
Share this question
or