RadWindow not popping up

2 posts, 0 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 07 Jun 2010 Link to this post

    I have to set up a RadWindow from code behind and then display it. It needs to be set up from the code-behind, because an event needs to fire to copy a file which the child page will display. After the file copy, I want the window to pop up. Nothing happens. The page just postsback with no activity.

    When I try putting it in the html and not the code behind, it works fine. Only problem is like I said above is that when the user clicks on the image, it needs to copied.  The JS OnClientClick event obvioulsy fires before the OnClick server side event (which does the file copying). Therefore, it has to be done in the code behind. If somebody can help me figure out what I'm doing wrong, I would greatly appreciate it.

    Here is my abbreviated HTML. Note that the RadScriptManager resides on a MasterPage:
    <code>

    <

     

    telerik:RadWindowManager ID="RadWindowManager1" runat="server">

     

     

    </telerik:RadWindowManager>

     

    <%-- <Windows>

    <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="1000px"

    Height="600px" Title="View Chart" Behaviors="Default" Skin="Outlook" Modal=true>

    </telerik:RadWindow>

    </Windows>--%>

    <%--<script type="text/javascript">

    //<![CDATA[

    function openRadWin() {

    radopen("../scan/viewChart.aspx", "RadWindow1");

    }

    //]]>

    </script>--%>

     

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">

     

     

    <AjaxSettings>

     

     

    <telerik:AjaxSetting AjaxControlID="RadGridBulkCharts">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="RadGridBulkCharts" LoadingPanelID="RadAjaxLoadingPanel1" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    <telerik:AjaxSetting AjaxControlID="chkBulk">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="chkBulk" LoadingPanelID="RadAjaxLoadingPanel1" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    <telerik:AjaxSetting AjaxControlID="RadGridEDLogFiles">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="RadGridEDLogFiles" LoadingPanelID="RadAjaxLoadingPanel1" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    <telerik:AjaxSetting AjaxControlID="chkEDLog">

     

     

    <UpdatedControls>

     

     

    <telerik:AjaxUpdatedControl ControlID="chkEDLog" LoadingPanelID="RadAjaxLoadingPanel1" />

     

     

    </UpdatedControls>

     

     

    </telerik:AjaxSetting>

     

     

    </AjaxSettings>

     

     

    </telerik:RadAjaxManager>

     

     

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">

     

     

    </telerik:RadAjaxLoadingPanel>
    <code>

    Notice I have the client code commented out which I said works fine just to see if it gets into the page_load event of the child page. It does from the client side (when the code is uncommented), but from the server side, the Load event is not hit.

    Here is my abbreviated server side code in the event once the onclick event happens:
    <code>

     

    protected void Chart_Click(object sender, ImageClickEventArgs e)
            {
               
                file = new FileInfo(ChartPath + imgName);
                string cpPath = (string)settingsReader.GetValue("tmpImageFolder", typeof(String)) + ViewState["UserName"].ToString();

                if (file.Exists)
                {
                    if (!Directory.Exists(cpPath))
                    {
                        Directory.CreateDirectory(cpPath);
                    }

                    file.CopyTo(cpPath + file.Name, true);

                    RadWindowManager1.Windows.Clear();
                    RadWindow newwindow = new RadWindow();
                    newwindow.ID = "RadWindow1";
                    newwindow.ShowContentDuringLoad = false;
                    newwindow.Width = Unit.Pixel(1000);
                    newwindow.Height = Unit.Pixel(600);
                    newwindow.Title = "View Chart Image";
                    newwindow.Behaviors = WindowBehaviors.Default;
                    newwindow.Skin = "Outlook";
                    newwindow.Modal = true;
                    newwindow.VisibleOnPageLoad = true;
                    newwindow.NavigateUrl = "../scan/viewChart.aspx";
                    newwindow.Visible = true;
                    RadWindowManager1.Windows.Add(newwindow);

                }
            }


    </code>

    I checked the  RadWindowManager1.Windows.Count property and shows it to be 1.

    What am I doing wrong that the page doesn't come up???

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 14 Jun 2010 Link to this post

    Hi William,

    I recommend you to use this approach in order to open a RadWindow from code behind.

    Regards,
    Fiko
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top