More in this section
Forums / Sitefinity SDK / RadWindow to open an Embedded User Control

RadWindow to open an Embedded User Control

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 1 answered
  1. Kristian
    Kristian avatar
    214 posts
    03 Jun 2010
    28 Feb 2011
    Link to this post
    I want to have a RadWindow open a Embedded User Control from my custom user control instead of using some static page for the navigateurl. Is there a special contenttype for .ascx? I got the window to open the embedded resource I want but it is displayed in plain html.

    [assembly: WebResource("Image.Resources.Views.UploadImage.ascx", "text/html;charset=utf-8")]

    void RadButton1_Click(object sender, EventArgs e)
                RadWindow testWindow = new RadWindow();
                testWindow.VisibleOnPageLoad = true;
                testWindow.Skin = "Sitefinity";
                ClientScriptManager cs = Page.ClientScript;
                Type rsType = this.GetType();
                testWindow.NavigateUrl = cs.GetWebResourceUrl(rsType, "Image.Resources.Views.UploadImage.ascx");

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    04 Mar 2011
    Link to this post
    Hello Kristian,

    The RadWidnow by default can either serve as an IFrame (when using navigate url) or you can use it as a NamingContainer and make it load content from the currently rendered html. You need to use the second approach and add an ASP.NET Panel to the ContentTemplate of the widnow. Then in this panel you can load embedded controls.

    Radoslav Georgiev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Brandon
    Brandon avatar
    1 posts
    13 Dec 2010
    23 Jun 2011
    Link to this post
    I am able to open a RadWindow from a ImageButton Click Event (ImageButton is located inside a Repeater) using this code:

    popFlashPlayer.VisibleOnPageLoad = true;
    ImageButton test = sender as ImageButton;
    var ctrl = Page.LoadControl(string.Format("{0}DesktopModules/Touchstone.PT.VW.Web/Passat/Views/VideoVoting/FlashView.ascx", BaseUrl));
    var panel = popFlashPlayer.ContentContainer.FindControl( "pnlFlash" );
    panel.Controls.Add( ctrl );

    code for RadWindow on main page:
    <telerik:RadWindow ID="popFlashPlayer" runat="server" VisibleOnPageLoad="false" Modal="true">
            <asp:Panel ID="pnlFlash" runat="server"></asp:Panel>

    code for RadAjaxManager on main page:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
            <telerik:AjaxSetting AjaxControlID="rptVideoVotingObjectives">
                    <telerik:AjaxUpdatedControl ControlID="popFlashPlayer" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlFlash" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lblError" LoadingPanelID="RadAjaxLoadingPanel1" />
            <telerik:AjaxSetting AjaxControlID="popFlashPlayer">
                    <telerik:AjaxUpdatedControl ControlID="popFlashPlayer" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlFlash" LoadingPanelID="RadAjaxLoadingPanel1" />
            <telerik:AjaxSetting AjaxControlID="btnTest">
                    <telerik:AjaxUpdatedControl ControlID="popFlashPlayer" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlFlash" LoadingPanelID="RadAjaxLoadingPanel1" />

    my code for LoadFlash in the loaded usercontrol executes, and everything works fine on the load

    The FlashView.ascx contains a button, but it's click event does not fire, The RadWindow closes briefly, then reopens as a blank page.

    Any insights why this may be happening?
3 posts, 1 answered