从一个 Web 部件访问信息并在 Sharepoint 2010 中的另一个 Web 部件中使用它
我的问题是这个,我正在使用 Sharepoint 2010,我在 sharepoint Designer 2010 中创建了一个表单,在该表单之上我有一个 silverlight web 部件。现在,当我单击 silverlight Web 部件并将该信息插入到其下方的表单中时,我需要能够从它访问信息。
有人对如何做到这一点有任何见解吗?
先感谢您。 克里斯
My problem is this one, I am using Sharepoint 2010, I have a form created in sharepoint designer 2010, above that form I have a silverlight webpart. Now I need to be able to access information from the silverlight webpart when I click on it and insert that information in the form below it.
Does anyone have any insight on how to do that?
Thank you in advance.
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 javascript、DOM 和 Silverlight 之间进行互操作。因此,您可以执行以下任一操作。
1) 在 Silverlight 代码中,使用 HtmlPage 和 System.Windows.Browser 命名空间中的其他项以编程方式填写表单。
2) 让您的 Silverlight 应用程序将数据传递给 javscript 函数,然后由该函数填写表单
3) 如果您的 Silverlight 应用程序未启动该操作,您可以使用一个 javascript 函数来调用您的 Silverlight 应用程序中的函数。本文解释了 http://blogs.silverlight.net/blogs/msnow/archive/2008/07/08/tip-of-the-day-15-communicating- Between-javascript-amp- silverlight.aspx
4) 如果您想依赖 Sharepoint WebPart 通信通道而不是尝试通过 DOM 访问 WebPart,您还可以让 Silverlight 填充隐藏字段,然后调用 javascript 回发函数。然后,Web 部件上的代码可以获取隐藏的字段数据并通过 Web 部件通信通道发送信息。
You can interoperate between javascript, the DOM, and Silverlight. As a result you can do any of the following.
1) In the Silverlight code, programmatically fill in the form using HtmlPage and other items in the System.Windows.Browser namespace.
2) Have your Silverlight app pass the data to javscript function that then fills in the form
3) If your Silverlight app is not initiating the action, you can have a javascript function that calls a function in your Sillverlight app. This article explains that http://blogs.silverlight.net/blogs/msnow/archive/2008/07/08/tip-of-the-day-15-communicating-between-javascript-amp-silverlight.aspx
4) If you are wanting to rely on the Sharepoint WebPart communication channels instead of trying to access the webparts through the DOM, you can also have Silverlight fill a hidden field and then call the javascript postback function. Your code behind on your webpart can then pick up the hidden field data and send the information though the webpart communication channls.