更新 SharePoint 2010 中的沙箱 Web 部件自定义属性
我有一个带有 Web 部件(带有 Silverlight)的 SharePoint 2010 沙箱解决方案。我的 Web 部件有一个自定义(字符串)属性。看来远程更新这个属性并不是一件容易的事。我一直在使用 SharePoint 的 WebPartPages.asmx Web 服务,但其加载/更新 Web 部件的方法在沙箱解决方案中不起作用,因为该 Web 部件被包装在另一个称为 SPUserCodeWebPart 的解决方案中。那么,有没有办法绕过这个限制呢?
我注意到,如果我公开该属性(WebBrowsable 属性 = true),我可以在左侧的工具窗格中修改它。但是,我不喜欢这种方式,因为我使用此属性作为属性包(带有我的自定义设置的 XML)。
I have a SharePoint 2010 sandbox solution with a webpart (with Silverlight). My webpart has a custom (string) property. It seems it is not an easy task to update this property remotely. I have been using WebPartPages.asmx web serivce of SharePoint but its methods for load/update of webparts don't work in sandbox solutions, because the webpart is wrapped in another one, called SPUserCodeWebPart. So, is there a way to bypass this restriction?
I have noticed, that if I expose the property (WebBrowsable attribute = true) I can modify it in the toolpane on the left. However, I don't like this way because I use this property as a property bag (XML with my custom settings).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使您成功完成此操作,您也会遇到权限问题(只有可以编辑 Web 部件的用户才能编辑该属性,如果您将其标记为可个性化,则所有用户都将拥有自己的属性版本),因此您必须移至此列表的存储。
Even if you get this working, you will hit the permissions problem (only users that can edit the webpart can edit the property, if you mark it as personalizable all users will have their own version of the property), so you have to move to a List storage for this one.