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); |
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

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?
Thanks,
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
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.

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 += "}"; |
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.

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

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:
- You have a RadAjaxManager on your master page.
- 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