How to close radwindow completely

3 posts, 0 answers
  1. Hamza
    Hamza avatar
    24 posts
    Member since:
    Feb 2011

    Posted 11 Nov 2011 Link to this post

    hi all :)

    I open some video at a radwindow, but after closing, the video still working

    how can I close the window and all controls inside it ?

    if I can to have another question, can I show radwindow without any border ?

    just like popup one



    thank you all :)
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Nov 2011 Link to this post

    Hello Hamza,

    Try the following code snippet to close the RadWindow. You need to inject the javascript function to the asp label as it's text and write the client side code to close the RadWindow as shown below in order to close the RadWindow.

    JS:
    <script language ="javascript" type ="text/javascript" >  
        function GetRadWindow()     
            {     
                var oWindow = null;     
                if (window.radWindow)
                    oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog     
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;//IE (and Moz as well)     
                return oWindow;               
            }     
          
            function Close()     
            {     
                  GetRadWindow().Close();          
            }         
    </script>

    ASPX:
    <asp:Label ID="Label1" Runat="server" Width="410px"></asp:Label>

    C#:
    protected void btn_Click(object sender, EventArgs e)   
    {   
      Label1.Text = "<script type='text/javascript'>Close()</" + "script>";   
    }

    To remove border from RadWindow you can take a look into the following forum thread which discussed the same.
    Remove the window border
    Window without border

    Thanks,
    Princy.
  3. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4613 posts

    Posted 15 Nov 2011 Link to this post

    Hello Hamza,

    Let me suggest another option. Please examine this help article: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-common.html and more precisely the first section (Video / audio keep playing after window is closed) as it describes your exact issue and offers two ways to cope with it.


    Regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top