开发者

Passing values out of silverlight unto webpage

Is that possible to have values inside a silverlight application be passed out unto the webpage, whether calling a javascript function with the values, etc.

The functionality I'm looking for: I have a map in silverlight, I select some values, I click the html submit button that is located on the webpag开发者_开发百科e. The values in silverlight and also whatever input was made on the webpage is sent to the server (ASP.NET MVC Controller).


Yes, it is possible by accessing the html elements in the page:

HtmlElement field = HtmlPage.Document.GetElementByID("hiddenFieldID");
field.SetProperty("innerHTML", "someValue");

You can call this functionality when the map control is updated inside the Silverlight control. When the submit will be called in the web page it'll have the value ready on the field.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜