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:



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





    <%-- <Windows>

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

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



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


    function openRadWin() {

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





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






    <telerik:AjaxSetting AjaxControlID="RadGridBulkCharts">






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









    <telerik:AjaxSetting AjaxControlID="chkBulk">






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









    <telerik:AjaxSetting AjaxControlID="RadGridEDLogFiles">






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









    <telerik:AjaxSetting AjaxControlID="chkEDLog">






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















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




    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:


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

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

                    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;



    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
    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.

    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