获取数据了Silverlight控件 [英] Getting data out of a Silverlight control

查看:106
本文介绍了获取数据了Silverlight控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是比较新的Silverlight开发,我试图找出如何让数据指出,我已经做了Silverlight控件。

I am relatively new to Silverlight development and I am trying to figure out how to get data out of a silverlight control that I have made.

我有一个Silverlight控件,收集了一堆图形数据点。 Silverlight控件嵌入是在asp.net web表单应用程序。这也显示控件的页做其他数据的特定功能,当用户点击一个按钮,我需要用1调用执行(包含在Silverlight控件都表单数据,并将数据)中的数据进行一些处理,然后将数据保存到数据库。

I have a Silverlight control that gathers a bunch of graphical data points. The Silverlight control is embedding in a asp.net webforms application. The page that is displaying the control also does other data specific functions and when the user clicks a button I need to perform some manipulation of the data (both webform data and the data contained in the Silverlight control) and then save the data with 1 call to the DB.

我的问题是我怎么获取数据的Silverlight控件从我的网络表单能够把数据一起保存?

My question is how do I get the data out of the Silverlight control from my webform to be able to put the data together for the save?

我最初的想法是让在通过JavaScript访问,然后点击按钮Silverlight控件中的数据,Silverlight控件的数据保存到一些HTML控件,然后允许进行常规的网页表单后,读取数据的服务器端。有没有更好的办法做到这一点,因为它感觉有点凌乱。

My initial thought was to make the data in the Silverlight control accessible via Javascript and then on the button click, save the Silverlight control's data to some html control and then allow the regular webform post to occur and read the data server side. Is there a better way to do this as it feels a little messy.

请注意:我使用.NET 3.5和Silverlight 3.0

Note: I am using .NET 3.5 and Silverlight 3.0.

推荐答案

您有很多的选择:


  • 您可以有你的Silverlight控件直接提交数据到服务器,使用ADO.NET数据服务或Web服务调用该处理数据

  • You can have your Silverlight control submit the data directly to the server, using ADO.NET Data Services or a webservice call which processes the data

您可以使用RIA Services,它简化了与Silverlight的服务器端code

You can use RIA Services, which simplifies the process of interacting with server-side code from Silverlight

您可以有Silverlight控件更新表单域(隐藏,可能),然后可以被处理,并通过网页提交

You can have the Silverlight control update a form field (hidden, probably) which then can be processed and submitted via the web page

这篇关于获取数据了Silverlight控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆