Problem opening Window From UserControl

2 posts, 0 answers
  1. Sunil
    Sunil avatar
    29 posts
    Member since:
    Jul 2010

    Posted 10 Sep 2010 Link to this post

    I have a .aspx page which has a user control in it. The application is ajax based.

    The .aspx page has a RadWindowManager which I've made a public property to access from other user controls.

    When I click on a button in my user control to open a radwindow, I don't get any errors and the correct page loads into a RadWindow. However, any styling or properties that I apply to the window are not carried across at all. It opens a RadWindow as if no settings were specified.

    Any help is much appreciated!

    (I have tested that the created RadWindow is actually added to the RadWindowManager... it is added. I also only have one RadWindowManager on that is on the aspx page throughout the application).

    Here is my code in the aspx page for the RadWindowManager and below it is the code behind.
    <telerik:RadWindowManager ID="RadWindowManager_Default" runat="server" Skin="Default" Animation="Fade" 
        AnimationDuration="300" DestroyOnClose="True">
        </telerik:RadWindowManager>
      
    ... code behind ...
      
    public RadWindowManager RWM_Default
            {
                get { return RadWindowManager_Default; }
                set { RadWindowManager_Default = value; }
            }

    Here is my code in the page_load event in the user control ascx for the new window.
    RadWindow Window_FR_View;
      
            protected void Page_Load(object sender, EventArgs e)
            {
                //Add window for popup
                Window_FR_View = new RadWindow();
                Window_FR_View.ID = "RadWindow_FR";
                Window_FR_View.NavigateUrl = "OnTime_Reports/fire_report_view_popup.aspx";
                Window_FR_View.Height = Unit.Pixel(600);
                Window_FR_View.Width = Unit.Pixel(400);
                Window_FR_View.Modal = true;
                Window_FR_View.VisibleStatusbar = false;
                Window_FR_View.Behaviors = Telerik.Web.UI.WindowBehaviors.Close;
      
                ((_Default)Page).RWM_Default.Windows.Add(Window_FR_View);
      
                //Register Javascript for RadWindow
                String script4 = "" +
                    "function openRadWindow_FR(Page_To_Open, RadWindow_Control_ID) " +
                    "{" +  
                        "radopen(Page_To_Open, RadWindow_Control_ID);" +
                    "}";
      
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "FR_LOAD", script4, true);


    Here is the code for the onclick event which tries to open the window
    protected void Button_Run_Fire_Report_OnClick(object sender, EventArgs e)
            {
                String script5 = "openRadWindow_FR(\"OnTime_Reports/fire_report_view_popup.aspx\", \"" + Window_FR_View.ClientID + "\");";
      
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "FR_LOAD_LIST", script5, true);
            }
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 14 Sep 2010 Link to this post

    Hello Sunil,

    Code looks OK so at this point I cannot tell what the problem might be. Please open a support ticket and send a sample project where this issue could be reproduced - once I have a better view over your exact setup and logic, I will do my best to provide you with a 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
Back to Top