Skip to main content

Microsoft Silverlight

Answered Question issue when passing silverlight values to aspx pageRSS Feed

(0)

kashyap415
kashyap415

Member

Member

5 points

11 Posts

issue when passing silverlight values to aspx page

I have a problem I am using silverlight control on a modelpopup and when i click a button in my silverlight control, i am using

HtmlPage.Window.Invoke("ValueFromSilverLight", "True");

to pass the value to my aspx page.

where my javascript is

function ValueFromSilverLight(SilverValue) {

if (SilverValue == "True") {

document.getElementById('<%=Button6.ClientID%>').click();

}

else {document.getElementById('<%=Button8.ClientID%>').click();

}

this worked fine before now this runtime error occurs;

Line: 187
Error: Invalid pointer

 Can anyone help me.

mrjvdveen
mrjvdveen

Participant

Participant

1939 points

367 Posts

Re: issue when passing silverlight values to aspx page

 Sounds to me that the JS function can not be found. Have you tried calling it from the aspx page itself? You could use the document.onload to test it.

HTH.

-------------
Please mark a post as answer if it answers your question.
Visit my blog: http://jvdveen.blogspot.com

hemanth53
hemanth53

Member

Member

11 points

8 Posts

Re: issue when passing silverlight values to aspx page

If you are still facing the issue, you can try with this alternative solution if your requirement matches.

Have a hidden field in the aspx(By default empty). When you want the button click event to be triggered, assign some value to this hidden field from the silver light code and Submit the aspx form from Silver Light code itself. 

In aspx.cs check for this hidden filed. If hidden filed is empty then it is Normal Flow. If this contains some value, Call your button click event or logic u want to implement. And later clear the hidden filed.

Amanda Wang - MSFT
Amanda W...

All-Star

All-Star

17241 points

1,466 Posts

Answered Question

Re: issue when passing silverlight values to aspx page

 Hi,

We have a test with your provided code in ourlabs, it works fine. 

Maybe, other code  of your page cause this problem, we would suggest that you can have a test with a new created project. And add the code to page step by step to find the cause.

Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

hemanth53
hemanth53

Member

Member

11 points

8 Posts

Re: issue when passing silverlight values to aspx page

May be the control id name is not proper. For example when master page concept comes into picture...the id of the control will be different.

To get that control id View Source in the Browser and then give the control id if i am rite.

 

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities