Microsoft CRM 2011 表单 Silverlight 控件的配置/设置
需要有关寻找解决方案的最佳实践的想法。
我们正在考虑为 CRM 表单开发 Silverlight 控件,这些控件需要引用通用的数据配置文件。这是一个需要每隔一段时间定期维护的文件。我们不想将值硬编码到 Silverlight 控件中。
我的问题是...我们在哪里/什么/如何为 Silverlight 控件提供配置文件?
我尝试上传一个 JS Web 资源,该资源只是一个 JSON 数组,其中包含我尝试从 Silverlight 控件访问的设置。当我使用管理员帐户和域帐户对文件进行 Http 获取并解析它时,我得到的只是权限错误。如果我设法解决这些烦人的权限错误,有人可以确认这可以工作吗?
我的下一个想法是拥有一个充满设置的 CRM 实体,Silverlight 控件可以对其进行 ODATA 调用以获取其配置数据。但我并没有 100% 接受这个想法。
也许人们一直在使用另一种方式 - 如果是这样 - 我很想看看你在做什么。这确实会阻止我们实现我们所追求的丰富的 Silverlight 解决方案。
提前致谢
Need an idea on best practise in finding a solution.
We are looking at developing Silverlight controls for CRM forms that will need to reference a common configuration file for data. It is a file that will need to be maintained periodically every once in a while. We don't want to be hardcoding values into the Silverlight control.
My question is... Where/What/How do we provide a config file for a Silverlight control?
I tried uploading a JS web resource that simply was a JSON array full of settings that I tried to access from the Silverlight control. All I got were permission errors when I used both the admin account and my domain account to do a Http get of the file and parse it. Can someone confirm that this could work if I manage to work through these annoying permission errors?
My next thought was having a CRM entity full of settings that the Silverlight control could make ODATA calls to in order to get its config data. I'm not 100% sold on the idea though.
Perhaps there is another way people have been using - if so - I'd love to see what you are doing. This could really prevent us from coming to a Silverlight enriched solution that we are after.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们通过两种方式来解决这个问题。
可以使用 WebClient.DownloadStringAsync() 在 Silverlight 中检索此 xml Web 资源,如下所示。
We go about this in two ways.
This xml web resource can be retrieved in Silverlight using WebClient.DownloadStringAsync() as shown below.
我们经常使用配置实体方法,我认为它效果很好。
您也应该能够使用您的初始方法...我知道在一些地方我们已经在 Web 资源中完成了一些 XML 配置,我们在 Silverlight 中检索、解析并使用了这些资源。
We use the configuration entity method quite often and I think it works well.
You should be able to use your initial method as well... I know in a few places we've done some XML configuration in a web resource that we've retrieved in Silverlight, parsed, and done something with.