Reason: Telerik RadHtmlPlaceholder control for Silverlight refuses to open certain Websites


While working with the Telerik RadHtmlPlaceholder control in a Silverlight application I noticed that, there are few issues availble with the control and after investigation, I found the reasons behind it. This post will help you to understand it in depth. - Article authored by Kunal Chowdhury on .

Yesterday while working with Telerik’s RadHtmlPlaceholder control for Silverlight, I noticed that, it is unable to open certain websites and showing a message that says “The content cannot be displayed in a Frame”.

 

After doing an investigation, I came to know that, it is default behaviour of the control we can not handle. Let’s discuss more on the issue and the reason behind it.

 

What is the Issue?

While working with the Telerik RadHtmlPlaceholder control in a Silverlight application I noticed that, most of the websites are opening inside the control but few are not though they are very reputed websites. For example, I am able to open www.bing.com but in case of www.google.com it is just showing a message that says “The content cannot be displayed in a Frame”.

 

I didn’t find any specific reason behind blocking those sites in the RadHtmlPlaceholder as my implementation was just simple as this:

 
 
<Grid x:Name="LayoutRoot" Background="White">
    <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <telerik:RadHtmlPlaceholder SourceUrl="http://www.bing.com" 
                                    Width="600" Height="400"/>
    </Border>
</Grid>

 

The above XAML code properly opened the bing search page in the control inside by Silverlight application:

 

Bing opens properly in RadHtmlPlaceholder

 

But when I tried by replacing just the SourceUrl of the RadHtmlPlaceholder control like this:

 
<Grid x:Name="LayoutRoot" Background="White">
    <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <telerik:RadHtmlPlaceholder SourceUrl="http://www.google.com" 
                                    Width="600" Height="400"/>
    </Border>
</Grid>

 

The control was unable to open it and was showing the following message in the page:

 

Unable to open Google in RadHtmlPlaceholder

 

The message itself says that, it is not able to open the site in the control as the site publisher is not allowing to display their content in a Frame. Though the message was simpler but as a developer I wanted to know more about it. Also, I wanted to know if there are any ways to handle such types of message and show the user a proper message. So, there my investigation started on this issue.

 

Reason behind it

After doing a lot of investigation, I came to know that, the RadHtmlPlaceholder displays all external pages in an IFrame object on top of the Silverlight plug-in. However, Google and few other sites are currently preventing all their pages from displaying in IFrame object. There are no other ways to control those pages display over the IFrame at the moment. Also there are no other approaches for displaying external pages in the RadHtmlPlaceholder.

 

When contacted with the Telerik team, I got the same message from them and they clearly mentioned that, they are not aware of any other alternative ways to show such web pages. Also they don’t have any control over IFrame to take next steps to show a proper message to the user like “404 Not Found page”, as the IFrame does not provide such APIs to the developers.

 

So, if you came across the same scenario and looking for an alternate way to show a custom page to the user, the simplest answer is “No, you can not do this” unless IFrame or the RadHtmlPlaceholder control provides some APIs to you. Share this information to your client if they are pushing you to implement it in your application. And yes, hope for the best to have the APIs in the future.

Have a question? Or, a comment? Let's Discuss it below...

dhgate

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.