RadHtmlPlaceHolder in SL 4.0 App

18 posts, 0 answers
  1. Daniel Walton
    Daniel Walton avatar
    18 posts
    Member since:
    Feb 2010

    Posted 21 Apr 2010 Link to this post

    I am using the latest build (0416) of the Silverlight 4 Tools, and I have a simple page with a RadHtmlPlaceHolder on it, and I get the following exception in the page constructor:

    The invocation of the constructor on type 'Telerik.Windows.Controls.RadHtmlPlaceholder' that matches the specified binding constraints threw an exception.

    I have tried using windowless=true and false on the app container.

    Here's my XAML:

    <navigation:Page x:Class="Raps.Views.SimplePage"  
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        Title="SimplePage Page"
        <Grid x:Name="LayoutRoot"
            <telerik:RadHtmlPlaceholder x:Name="hph" SourceUrl="/Editor.aspx?templateid=1" /> 
        </Grid> 
    </navigation:Page> 




  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 22 Apr 2010 Link to this post

    Hi Daniel Walton,
    You should set the windowless parameter to True. See this help article:
    http://www.telerik.com/help/silverlight/radhtmlplaceholder-getting-started.html

    Are you using a web application to display the SL app?

    Greetings,
    Valentin.Stoychev
    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.
  3. DevCraft banner
  4. Daniel Walton
    Daniel Walton avatar
    18 posts
    Member since:
    Feb 2010

    Posted 22 Apr 2010 Link to this post

    Valentin,

    Thanks for the response. Setting the windowless parameter to true has no effect. Yes, I am using a web application to display the app. (Silverlight Business Application template).

    -Dan
  5. Daniel Walton
    Daniel Walton avatar
    18 posts
    Member since:
    Feb 2010

    Posted 22 Apr 2010 Link to this post

    Nevermind, I'm an idiot. All along I had a typo:

    <param name="windowless" value"true" /> 


    -Dan




  6. SHEIKH
    SHEIKH avatar
    43 posts
    Member since:
    Sep 2010

    Posted 20 Oct 2010 Link to this post

    Hi all,
    I'm having the same problem.
    This is my html silverlight host page.

    <form id="form1" runat="server" style="height:100%">
        <div id="silverlightControlHost">
            <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
              <param name="source" value="ClientBin/Lease.Client.xap"/>
              <param name="onError" value="onSilverlightError" />
              <param name="background" value="white" />
              <param name="minRuntimeVersion" value="4.0.50401.0" />
              <param name="autoUpgrade" value="true" />
              <param name="windowless" value="true" />
              <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration:none">
                   <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
              </a>
            </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
        </form>

    And this is the sample xaml for htmlplaceholder control from the Samples which I'm trying to run under a separate project that is invoked from example.xaml .

    <UserControl
            x:Class="Telerik.Windows.Examples.HtmlPlaceholder.FirstLook.HtmlPlaceholder1UserControl"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls">   
        <StackPanel>
            <telerik:RadHtmlPlaceholder x:Name="htmlPlaceholder1" SourceUrl="http://google.com" />
        </StackPanel>
    </UserControl>

    And I'm still getting the following error on runtime.
    System.Windows.Markup.XamlParseException occurred
      Message=The invocation of the constructor on type 'Telerik.Windows.Controls.RadHtmlPlaceholder' that matches the specified binding constraints threw an exception. [Line: 7 Position: 73]
      LineNumber=7
      LinePosition=73
      StackTrace:
           at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
           at Telerik.Windows.Examples.HtmlPlaceholder.FirstLook.HtmlPlaceholder1UserControl.InitializeComponent()
           at Telerik.Windows.Examples.HtmlPlaceholder.FirstLook.HtmlPlaceholder1UserControl..ctor()
      InnerException: System.Collections.Generic.KeyNotFoundException
           Message=The given key was not present in the dictionary.
           StackTrace:
                at System.ThrowHelper.ThrowKeyNotFoundException()
                at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
                at System.Windows.ResourceManagerWrapper.GetResourceForUri(Uri xamlUri, Type componentType)
           InnerException:

    Can someone here tell me what I'm doing wrong?


    Thanks,
  7. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 25 Oct 2010 Link to this post

    Hello Sheikh,

    I am not able to reproduce the issue. Please find attached a project with your code snippets. Have a look at it and let me know if I am missing something.

    All the best,
    Kiril Stanoev
    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
  8. SHEIKH
    SHEIKH avatar
    43 posts
    Member since:
    Sep 2010

    Posted 25 Oct 2010 Link to this post

    Hi Kiril,
    Thanks for your the sample. The problem got fixed when I switched my startup page to aspx instead of HTML page. It must have been my misc project I know but thats how I got my windowless parameter set.


    best regards,
  9. Manish
    Manish avatar
    6 posts
    Member since:
    Apr 2012

    Posted 09 Apr 2012 Link to this post

    i have to show a swf in my project..
    I have used radhtmlplace holder and made windowless=true as well.still it is showing xaml parse exception
  10. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 11 Apr 2012 Link to this post

    Hello Manish,

     Can you make sure that your Default startup page in Visual Studio is the one that you set the windowless parameter to true?

    All the best,
    Miro Miroslavov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. Manish
    Manish avatar
    6 posts
    Member since:
    Apr 2012

    Posted 11 Apr 2012 Link to this post

    yes i have done that
  12. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 13 Apr 2012 Link to this post

    Hello Manish,

     Can you post little bit more information. It will be better if you can send us example project or some code snippets of your HtmlPlaceholder usage and your html/aspx page. 
    Thank you.

    Regards,
    Miro Miroslavov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  13. Manish
    Manish avatar
    6 posts
    Member since:
    Apr 2012

    Posted 13 Apr 2012 Link to this post

     

     

     

    <Border Background="White" BorderBrush="Black" Height="230" BorderThickness="0.2" Grid.Column="2" Grid.Row="3">

     

     

     

     

    <telerik:RadHtmlPlaceholder SourceUrl="./Images/appsportfolio_homepage.swf"></telerik:RadHtmlPlaceholder>

     

     

     

     

    </Border>

    I am using it in this way.and not getting anything with this as there is XAML parse exception.

     

  14. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Apr 2012 Link to this post

    Hi Manish,

    Unfortunately we still can't reproduce the issue. Can you please have a look at the attached sample that I used to test your scenario and let me know if it works for you. Also, if it doesn't illustrate correctly your scenario, can you please modify it accordingly so that we can reproduce the issue locally and investigate what might be causing it?

    Thank you in advance.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  15. Jim
    Jim avatar
    1 posts
    Member since:
    Mar 2012

    Posted 09 May 2012 Link to this post

    Tina,

    I was able to reproduce this problem today and found this thread while researching a solution.  

    The issue occurs for me when running an application directly, resulting in the file:// URI scheme instead of http://.

    For instance, we have a Silverlight application ("Project") and the host application ("Project.Web"). In Visual studio, right-clicking "Project" and choosing Debug -> Start New Instance causes the error, whereas right-clicking "Project.Web" and choosing Debug -> Start New Instance does not.

    I believe the problem is that "Project.Web" project contains the HTML object element with the required:
              <param name="windowless" value="true" />

    Thanks,

    Jim
  16. Manish
    Manish avatar
    6 posts
    Member since:
    Apr 2012

    Posted 10 May 2012 Link to this post

    Tina,

    I need to run a swf file "abc.swf" in silverlight 4..I have tried so many things..Kindly let me know the how i can run it.
    I want to run it inside a stack panel.
    Plz let me know the complete workaround(if possible).

    Thanks,
    Manish
  17. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 14 May 2012 Link to this post

    Hello guys,

    @Jim - You need to run the Silverlight plug-in in a windowless mode even if the Silverlight project is used as a start-up project. You can follow this KB article to set the windowless parameter on the auto-generated html page.

    @Manish - Have you tried the application I have previously attached in this thread? It demonstrates how to display a .swf file in the RadHtmlPlaceholder. Basically you need to make sure that the .swf file is visible to the world and set the RadHtmlPlaceholder.SourceUrl property to the Url pointing to the .swf file. Let me know if you encounter any issues with that.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  18. Manish
    Manish avatar
    6 posts
    Member since:
    Apr 2012

    Posted 23 Jul 2012 Link to this post

    Hi Tina,

    I have tried the application which you have sent me but i am able to run it only if i am running it through the host.(e.g Project.Web instead of Project).But my problem is that i have to deploy my application on SP 2010 using silverlight webpart..and there it is not working.In SP2010 i have to deploy the xaps of my project.

    Please suggest me how can do this?

    Regards,
    Manish
  19. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 26 Jul 2012 Link to this post

    Hello Manish,

    I'm not sure if I understand the issues you're having when hosting the applicaiton in SharePoint. However, in SharePoint you also have to make sure that the Silverlight plug-in hosting the WebPart is in windowless mode. You can set it manually - by editing the html/aspx page hosting the WebPart or by extending the StringBuilder that creates the plug-in (stringBuilder.AppendLine("<param name=\"windowless\" value=\"true\" />");). The approach really depands on the way you're adding the WebParts into your SharePoint site.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner