RadWindow in server side

8 posts, 1 answers
  1. Bogice
    Bogice avatar
    3 posts
    Member since:
    Mar 2010

    Posted 25 Mar 2010 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Mar 2010 Link to this post

    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.

  3. Bogice
    Bogice avatar
    3 posts
    Member since:
    Mar 2010

    Posted 26 Mar 2010 Link to this post

    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
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Mar 2010 Link to this post

    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.
  5. Free Developer
    Free Developer avatar
    1 posts
    Member since:
    Mar 2010

    Posted 30 Mar 2010 Link to this post

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

  6. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 31 Mar 2010 Link to this post

    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.
  7. Bogice
    Bogice avatar
    3 posts
    Member since:
    Mar 2010

    Posted 31 Mar 2010 Link to this post

    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
  8. James Wofford
    James Wofford avatar
    20 posts
    Member since:
    Aug 2012

    Posted 29 Nov 2010 Link to this post

    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

Back to Top