Thanks
16 Answers, 1 is accepted
This should not be a problem. How you are executin the Javascript code? Is the code executed at all?
Kind regards,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks.
Are you using the the html placeholder with inline content (using the HtmlSource property) or are you refering external page (by using the SourceUri property)?
Sincerely yours,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks
The reason why you can't get the Silverlight object is that your code is in different HTML page which do not "know" about the Silverlight application. You need to write a logic in your external page in order to get the Silverlight application.
I've prepared a simple project where this is implemented. Please let us know if you need any clarification,
Kind regards,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
The example works wonderfully for me (Supplied Project)...
I understand I need to put the code below at the TOP PAGE, which I did.
My RADHTMLPlaceHolder is inside a TAB which is inside a pane.
So, then I try
var
silverlightApplication = parent.GetSilverlightApplication();
it was returning me a null pointer as parent is not the RootVisualTab.
How do I get the pointer to RootVisualTab in the Javascript inside a RadHtmlPlaceHolder?
===== CODE FOLLOWS =====
HtmlPage.RegisterScriptableObject("MySilverlightPage", this);
}
[
ScriptableMember]
public void HandleOutSideClick()
{
LayoutRoot.Background =
new SolidColorBrush(Colors.Red);
}
This code:
var silverlightApplication = parent.GetSilverlightApplication();
should stay in the html page - this is a javscript code - it is not supposed to be executed in the Silverlight application.
Can you send us your project so we can modify it for you. Please send a support ticket with the project attached.
All the best,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thanks a lot.
Valentin, can you confirm this?
Yes - this example addresses the scenario where you use the HtmlPlaceholder with external page.
The solution for the HtmlSoure will be different. Please let us know your specific problem to see if we can help.
All the best,
Valentin.Stoychev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
RadHtmlPlaceholder is part of the Silverlight environment, so I don't see any reason it being unable to call managed code. However, calling JavaScript code is not allowed since OOB applications have no connection to the DOM.
Greetings,
Kiril Stanoev
the Telerik team
I need to access an external URL via an htmlPlaceholder. This works fine. I also need the external url to return a response to my silverlight application (send a string). This works fine using the sample in this thread (By registering a scriptable object and then register a ScriptableMember which intercepts a function call from the external web page with a string as parameter.)
BUT, this seems to only work fine if the two web-sites sit in the same domain, but in my case, the external url is on a different server (Silverligt application on an IIS server, the other on an apache server)
The apache web-page only get the error "no access/permission" if it tries to call the event in the parent Silverlight application.
Is there a way the htmlPlaceholder can handle communication back from a web page to a Silverlight App in a different domain?
This communication doesn't really depend on the RadHtmlPlaceholder as it is rather a cross-domain issue. You can take a look at this article for more information.
Regards,
Tina Stancheva
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.