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

Javavscript inside of htmlplaceholder

6 Answers 128 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
MGrassman
Top achievements
Rank 2
MGrassman asked on 04 Jun 2009, 09:11 PM
I'm trying to place javascript code inside the htmlplaceholder.  This doesn't seem to work.   No error just no alert or anything that would let me know this is working.

I am aware that the control is called HTMLPlaceHolder but I figure one can't live with out the other.

html.HtmlSource = "alert('test');";

Any ideas?

Thanks,

6 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 05 Jun 2009, 06:59 AM
Hi Michael,

Inserting JavaScript code in the HtmlSource property of the RadHtmlPlaceholder control is not supported. However, in case you need to execute JavaScript code on the page hosting your Siverlight application you can use the following code:

HtmlPage

 

.Window.Eval(@"alert('test');");

Let me know if you have other questions.

Kind regards,
Tihomir Petkov
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alexy
Top achievements
Rank 1
answered on 25 Jun 2009, 09:56 PM
Hey Tihomir,

You said it's not possible to insert the javascript code into the HTMLPlaceHolder, but is it possible to invoke javascript methods?
If not, are you palnning to have that in next versions? This will be very nice. Thanks.
0
Valentin.Stoychev
Telerik team
answered on 26 Jun 2009, 05:43 AM
Hello Alexy,

You can call javascript from the silverlight application.

You can see more info here:
http://msdn.microsoft.com/en-us/library/cc645076%28VS.95%29.aspx

Regards,
Valentin.Stoychev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alexy
Top achievements
Rank 1
answered on 26 Jun 2009, 01:01 PM
Hey Valentin,
I mean HTMLPlaceHolder, and JavaScript inside it.

Example, I set the SourceUri to my web site that has JavaScript code that I want to invoke.
0
Kiril Stanoev
Telerik team
answered on 26 Jun 2009, 03:37 PM
Hello Alexy,

Please have a look at this KB article as it explains how to invoke Javascript from a page hosted in RadHtmlPlaceholder.

Kind regards,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alexy
Top achievements
Rank 1
answered on 26 Jun 2009, 06:02 PM
Thanks guys!
Very appreciate. Works fine.
Tags
HTMLPlaceHolder
Asked by
MGrassman
Top achievements
Rank 2
Answers by
Tihomir Petkov
Telerik team
Alexy
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Kiril Stanoev
Telerik team
Share this question
or