开发者

Silverlight Javascript - Access and setting value of xaml's textbox in javascript

开发者 https://www.devze.com 2023-03-12 12:54 出处:网络
I have a text box named myTextbox in 开发者_JAVA技巧my xaml page, my question is how can i set it\'s text through javascript from my aspx page.Create a public string property in the silverlight side,

I have a text box named myTextbox in 开发者_JAVA技巧my xaml page, my question is how can i set it's text through javascript from my aspx page.


Create a public string property in the silverlight side, mark it with the ScriptableMemberAttribute, and bind the textbox text property to this public property. The property marked with the ScriptableMemberAttribute is visible to javascript.

The code to access a silverlight property from javascript depends on the names you have used for those objects, but you have examples here on how to access them:

http://msdn.microsoft.com/en-us/library/cc221414%28v=VS.95%29.aspx

More info on making silverlight objects visible to javascript : http://msdn.microsoft.com/en-us/library/cc645085%28v=VS.95%29.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消