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
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.
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
<param name="windowless" value"true" /> |
-Dan
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,
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
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,
I have used radhtmlplace holder and made windowless=true as well.still it is showing xaml parse exception
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 >>
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.
Miro Miroslavov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
<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.
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 >>
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
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
@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 >>
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
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.
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.