Skip to main content

Microsoft Silverlight

Answered Question How communicate Silverlight Control with JQuery??RSS Feed

(0)

mlho
mlho

Member

Member

3 points

7 Posts

How communicate Silverlight Control with JQuery??

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

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Re: How communicate Silverlight Control with JQuery??

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"

mlho
mlho

Member

Member

3 points

7 Posts

Re: Re: How communicate Silverlight Control with JQuery??

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

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24939 points

2,425 Posts

Microsoft
Answered Question

Re: Re: How communicate Silverlight Control with JQuery??

Hi Mlho, 

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

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities