Javavscript inside of htmlplaceholder

7 posts, 0 answers
  1. MGrassman
    MGrassman avatar
    92 posts
    Member since:
    Apr 2007

    Posted 04 Jun 2009 Link to this post

    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,
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 05 Jun 2009 Link to this post

    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.
  3. DevCraft banner
  4. Alexy
    Alexy avatar
    11 posts
    Member since:
    May 2009

    Posted 25 Jun 2009 Link to this post

    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.
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 26 Jun 2009 Link to this post

    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.
  6. Alexy
    Alexy avatar
    11 posts
    Member since:
    May 2009

    Posted 26 Jun 2009 Link to this post

    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.
  7. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 26 Jun 2009 Link to this post

    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.
  8. Alexy
    Alexy avatar
    11 posts
    Member since:
    May 2009

    Posted 26 Jun 2009 Link to this post

    Thanks guys!
    Very appreciate. Works fine.
Back to Top
DevCraft banner