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

RadHtmlPlaceHolder in SL 4.0 App

17 Answers 498 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel Walton
Top achievements
Rank 1
Daniel Walton asked on 21 Apr 2010, 09:12 PM
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> 




17 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 22 Apr 2010, 09:11 AM
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.
0
Daniel Walton
Top achievements
Rank 1
answered on 22 Apr 2010, 01:49 PM
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
0
Daniel Walton
Top achievements
Rank 1
answered on 22 Apr 2010, 01:58 PM
Nevermind, I'm an idiot. All along I had a typo:

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


-Dan




0
SHEIKH
Top achievements
Rank 1
answered on 20 Oct 2010, 02:22 PM
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,
0
Kiril Stanoev
Telerik team
answered on 25 Oct 2010, 09:21 AM
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
0
SHEIKH
Top achievements
Rank 1
answered on 25 Oct 2010, 10:10 AM
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,
0
Manish
Top achievements
Rank 1
answered on 09 Apr 2012, 07:11 AM
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
0
Miro Miroslavov
Telerik team
answered on 11 Apr 2012, 10:01 AM
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 >>

0
Manish
Top achievements
Rank 1
answered on 11 Apr 2012, 10:03 AM
yes i have done that
0
Miro Miroslavov
Telerik team
answered on 13 Apr 2012, 08:54 AM
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 >>

0
Manish
Top achievements
Rank 1
answered on 13 Apr 2012, 09:07 AM

 

 

 

<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.

 

0
Tina Stancheva
Telerik team
answered on 17 Apr 2012, 05:04 PM
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 >>

0
Jim
Top achievements
Rank 1
answered on 09 May 2012, 05:38 PM
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
0
Manish
Top achievements
Rank 1
answered on 10 May 2012, 07:06 AM
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
0
Tina Stancheva
Telerik team
answered on 14 May 2012, 06:05 PM
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 >>

0
Manish
Top achievements
Rank 1
answered on 23 Jul 2012, 06:16 PM
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
0
Tina Stancheva
Telerik team
answered on 26 Jul 2012, 11:27 AM
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.

Tags
HTMLPlaceHolder
Asked by
Daniel Walton
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Daniel Walton
Top achievements
Rank 1
SHEIKH
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Manish
Top achievements
Rank 1
Miro Miroslavov
Telerik team
Tina Stancheva
Telerik team
Jim
Top achievements
Rank 1
Share this question
or