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

Passing HTML from silverlight to an HTMLPage

5 Answers 67 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
mirang
Top achievements
Rank 1
mirang asked on 02 Sep 2011, 09:55 AM
This is with reference to the following url :

http://www.telerik.com/support/kb/silverlight/htmlplaceholder/htmlplaceholder-javascript.aspx

Here normal text is being passed to the HTML page.

In the same function I tried passing the following string  :

string abcde = "<html xmlns:v='urn:schemas-microsoft-com:vml'><body>this is first</body></html>";
string code = "document.getElementById('myIFrame').contentDocument.body.innerHTML = '" + abcde + "'";
HtmlPage.Window.Eval(code);

which is throwing the exception "Eval FAiled"

5 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 02 Sep 2011, 02:02 PM
Hello Mirang,

If appears that ContentDocument is null. You can check that with the following code:

string code = "alert(document.getElementById('myIFrame').contentDocument != null)";

Greetings,
Kiril Stanoev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
mirang
Top achievements
Rank 1
answered on 02 Sep 2011, 02:53 PM
The same code works for a different string
string abcde = "<html><body>this is first</body></html>";
string code = "document.getElementById('myIFrame').contentDocument.body.innerHTML = '" + abcde + "'";
HtmlPage.Window.Eval(code);

the only string missing is in the above string is :
xmlns:v='urn:schemas-microsoft-com:vml'
0
Kiril Stanoev
Telerik team
answered on 06 Sep 2011, 12:21 PM
Hello Mirang,

I am still getting the same error. Please take a look at the attached project for further reference and let me know if I am missing anything. I am testing against Internet Explorer 9 (9.0.8112.16421).

Kind regards,
Kiril Stanoev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
mirang
Top achievements
Rank 1
answered on 07 Sep 2011, 06:00 AM
The attached project runs on my end, i am also using the same internet explorer version 9 (9.0.8112.16421).
0
Kiril Stanoev
Telerik team
answered on 08 Sep 2011, 12:56 PM
Hi Mirang,

Since the example works at your end, you can remove the xmlns:v='urn:schemas-microsoft-com:vml', since this namespace is really not necessary for  VML in order to work properly with IE.

http://groups.google.com/group/google-maps-api/browse_thread/thread/2f3b8c2ff261873a?pli=1

Kind regards,
Kiril Stanoev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
HTMLPlaceHolder
Asked by
mirang
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
mirang
Top achievements
Rank 1
Share this question
or