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

RadHtmlPlaceholder HTML5 problem

7 Answers 42 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Hans-Jürgen
Top achievements
Rank 1
Hans-Jürgen asked on 01 Dec 2011, 12:54 PM
Hi ,

in my Silverlight app I used to do the following to call a Javascript function in a html page loaded in a RadHtmlPlaceholder

HtmlElement iframe = myradhtmlplaceholder.HtmlPresenter.Children[0] as HtmlElement;
iframe.SetAttribute("id", "myID");
HtmlObject myhtmlobj = HtmlPage.Document.GetElementById("myID").GetProperty("contentWindow") as HtmlObject;

myhtmlobj.Invoke("MyFunction", new string[] { "This is a test" });


Now I have a HTML version 5 page where I still have my 'MyFunction' javascript function defined, but
myhtmlobj  is NULL.

Do I need (for html5) do a different call to get a handle for the htmlwindow ?

Hope you can help.
Best regards
Hans-Juergen


7 Answers, 1 is accepted

Sort by
0
Hans-Jürgen
Top achievements
Rank 1
answered on 01 Dec 2011, 01:44 PM
Hi,

for your information
I used FF v8 . The html 5 page I open is: http://www.proteax.dk/proteax_live/protein_editor.py/show

The name of the function I try to call is:
loadProtein

Regards
Hans-Juergen

0
Kiril Stanoev
Telerik team
answered on 02 Dec 2011, 10:36 AM
Hello Hans-Jürgen,

Is the code you're showing working if the HTML page was not v. 5? This article explains the exact steps to calling a JS function with RadHtmlPlaceholder. 

All the best,
Kiril Stanoev
the Telerik team

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

0
Hans-Jürgen
Top achievements
Rank 1
answered on 04 Dec 2011, 11:21 AM
Hi Kiril,

turns out that the problem is due to crossdomain access.
The html 5 page I specify in the sourceurl of the radhtmlplaceholder control is not in the same domain as the silverlight application.

Since the html5 page resides in a apache webserver on a unix machine:
How does apache/linux handle those crossdomain calls.
In Windows (IIS) you place a clientaccesspolicy.xml in the root of the IIS webserver and this allows the sl app to access the page.
We tried placing clientaccesspolicy.xml and crossdomain.xml in the root of the apache webserver on the linux machine, but the access fails.
Does Apache (or Apache on Linux) handles the requests to call a javascript function in a page residing on the apache webserver DIFFERENT than IIS/Windows.

What do I need to do to allow my SL app to access Javascript functions residing in pages hosted on Apache/Linux ??


Hope you can help.
Best regards
Hans-Juergen 
 
0
Kiril Stanoev
Telerik team
answered on 05 Dec 2011, 01:51 PM
Hello Hans-Jürgen,

 To be honest I am not really sure how an Apache server handles the requests and which are the additional steps you must perform to make crossdomain calls work. Since it is a more general question, I'd advice you to post it in either on Silverlight.NET forums or stackoverflow. Meanwhile, if you permit, it would be great if we turn this support ticket to a forum thread since there might be a member of the Telerik community who has knowledge on the subject.

Greetings,
Kiril Stanoev
the Telerik team

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

0
Hans-Jürgen
Top achievements
Rank 1
answered on 05 Dec 2011, 02:10 PM
Hi Kiril,

no problem to post that in the telerik forum.
The question I need to answer is:

What do I need to on Apache/Linux to allow a Silverlight app to do crossdomain java scripting ? The Silverlight app is hosted in IIS/Windows and the external html page (placed in RadHtmlPlaceholder) is hosted on Apache/Linux ?

Hope the bigger audience can help.
Best
Hans-Juergen


0
Kiril Stanoev
Telerik team
answered on 06 Dec 2011, 09:07 AM
Hi Hans-Jürgen,

I have converted this support ticket to a forum thread. Let's see if anyone else can help.

All the best,
Kiril Stanoev
the Telerik team

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

0
hwsoderlund
Top achievements
Rank 1
answered on 07 Dec 2011, 12:17 PM
I do not think that this can be solved with a client access policy file on the server. AFAIK, that file only regulates if the silverlight app or a flash app can make requests to pages or web services on other domains. It has nothing to do with javascript calls. You may want to check out the information on this page and see if it helps you.
Tags
HTMLPlaceHolder
Asked by
Hans-Jürgen
Top achievements
Rank 1
Answers by
Hans-Jürgen
Top achievements
Rank 1
Kiril Stanoev
Telerik team
hwsoderlund
Top achievements
Rank 1
Share this question
or