RadWindow to open an Embedded User Control - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

RadWindow to open an Embedded User Control

  • RadWindow to open an Embedded User Control
  • 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");

  • 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!
  • 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("0DesktopModules/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?