locked
How communicate Silverlight Control with JQuery?? RRS feed

  • Question

  • hello, unfortunately i don't know like a passing values within a jquery function in which is called by asyncpostback in the Inserted event of a FormView in asp.net, after a postback to communicate with a Silverlight app, so not I call it from javascript .. since I call the function in that event, but if I can call from jquery, my problem is this code:

    $ (document). ready (function () (
    var slhost = $("<%= Silverlight1.ClientID %>");
    slhost.content.ItemInfo.SetInfoItem (true); / / ERROR: content.ItemInfo object is null.
    ----------
    if I execute this code .. works well, but it is not called pq asyncpostback ..

    InsertItem function () (
         var slhost = document.getElementById ('<%= Silverlight1.ClientID %>');
         slhost.content.ItemInfo.SetInfoItem (true);
    )

    please help me, almost demigods and gods
    Monday, November 2, 2009 10:36 PM

Answers

  • Hi Mlho, 

    Pravinku, thanks for answering, look at these links somewhat related but these examples do not send information from asp.net to Silverlight, since Silverlight does to html.

    If we want to send something to Silverlight, we'd better add a Scriptable method our Silverlight application.  This will make us to call the method in Javascript way.

    Best regards,

    Jonathan

    Monday, November 9, 2009 5:31 AM

All replies

  • Hi,

    Check the below articals. Those may help you to call JQuery into Silverlight App.

    http://www.cynotwhynot.com/blog/post/Fun-with-Silverlight-and-jQuery.aspx

    http://www.cynotwhynot.com/blog/post/Calling-jQuery-directly-from-Silverlight.aspx

    Thanks,

    Pravin

    "Please mark as answered, if this answers your question"

    Monday, November 2, 2009 11:12 PM
  • Pravinku, thanks for answering, look at these links somewhat related but these examples do not send information from asp.net to Silverlight, since Silverlight does to html. Is it that I have to add a jquery-extension.js of silverlight, which is perhaps why not read?, I can't find the right solution, please help. I've been weeks without sleep
     
    ------------------------------- 
    this code works but this execute before of the event Inserted,
    I therefore do not work..
    javascript
     
    var slhost = documentById('Silverlight1');
    slhost.content.learnsilverlight.sayhello(true);
     ------------------------------
    this code should works but i not have idea!
    jquery
     
    var slhost = $("#Silverlight1");
    slhost.content.learnsilverlight.sayhello(true); // ERROR content.learnsilverlight not found or is object is null
    Monday, November 2, 2009 11:39 PM
  • Hi Mlho, 

    Pravinku, thanks for answering, look at these links somewhat related but these examples do not send information from asp.net to Silverlight, since Silverlight does to html.

    If we want to send something to Silverlight, we'd better add a Scriptable method our Silverlight application.  This will make us to call the method in Javascript way.

    Best regards,

    Jonathan

    Monday, November 9, 2009 5:31 AM