This is a migrated thread and some comments may be shown as answers.

setUrl not working for RadWindow

1 Answer 162 Views
Window
This is a migrated thread and some comments may be shown as answers.
K
Top achievements
Rank 1
K asked on 03 Nov 2012, 04:17 AM
hi there,
i have read many blog posts and have tried several different things and am stuck.

I have a Radwindow which contains a YouTube video. When I close the window, the audio continues to play.

I read all the blog posts (http://blogs.telerik.com/blogs/posts/09-06-04/common-radwindow-issues-and-their-solution.aspx) and attempted to perform the same methodology.

Here is my code on the aspx page:

<telerik:RadWindow ID="rwOrgDetails" runat="server" Modal="true"
       Behaviors="Close,Move"
        ShowContentDuringLoad="False" AutoSize="true"
        AutoSizeBehaviors="Default" MinWidth="400px" Animation="FlyIn"
        KeepInScreenBounds="True" VisibleStatusbar="False"
        OnClientShow="re" DestroyOnClose="true" OnClientClose="OnClientClose" EnableViewState="False">
     <ContentTemplate>
        <asb:organization ID="detailedView" runat="server" />
        <div align="center" class="hiddenClose" style="display:none" >
          <telerik:RadButton ID="RadButton6" SkinID="Close" runat="server" OnClientClicking="cw">
            </telerik:RadButton>      
        </div>
     </ContentTemplate>  
    </telerik:RadWindow>

Within the same page I have the following script:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
 
    function OnClientClose(oWnd) {
        oWnd.setUrl("about:blank"); // Sets url to blank
  
   </script>
  </telerik:RadScriptBlock>

The function is being accessed, as I have put some alert("test") code in there to make sure but the video continues to play and I dont know if about:blank is being set correctly.

Any help is much appreciated.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Nov 2012, 12:15 PM
Hello,

From what I can gather you add the YouTube video in the asb:organization user control. If so - I can advise that you utilize the YouTube API and pause it in the OnClientClose event.

What is described in the blog post relates to the NavigateUrl property of the RadWindow as this was the only option at the time of writing of the post. What you have now is the ContentTemplate that cannot be disposed like this. It stays in the markup, unlike an iframe's content whose URL you can change. This is simple a different mode of theRadWIndow that has its own pros and cons. More on them you can find in this demo.

Another suggestion I can give is simply migrating the content you now have to a separate page and using that in the RadWindow instead of the ContentTemplate.

 

Regards,
Marin Bratanov
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.
Tags
Window
Asked by
K
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or