如何获取链接到 Sharepoint 的 InfoPath 表单中的查询字符串?
我知道我可以使用 InfoPath 中的代码隐藏文件发挥一些作用,但是当您将自定义 InfoPath 表单链接到 SharePoint 列表时,InfoPath 似乎会变得愚蠢并忘记如何执行开发人员的工作。
请注意,通过 SharePoint 2010 打开表单时缺少“开发人员”选项卡:
这使我无法进行任何“正常”的实际编码。
不使用代码隐藏文件的一般共识是使用 Web 部件。 http://blogs.msdn.com/b/infopath/archive/2010/06/03/how-to-pass-querystring-data-into-an-infopath-form.aspx
但这假设您可以控制您的 Web 部件。当我的用户直接转到 SharePoint 列表并尝试添加项目时,我想包含一个 URL 参数。直接从列表中访问时,页面上不会有任何 Web 部件。所以我也不能用这个方法。 (无论如何,这样做似乎是一个科学怪人的拼凑)
是否有任何其他方法可以简单地从 URL 查询字符串中获取参数?这似乎是一项非常简单的任务,但做起来却不必要且不切实际,就像 MS 决定欺骗自己一样。我确信这是有原因的,但我不知道那个原因是什么。
I know that I can do some magic with code-behind files in InfoPath, but when you have an custom InfoPath form linked to a SharePoint list, InfoPath seems to get stupid and forget how to do developer stuff.
Note the lack of the "Developer" tab when opening a form through SharePoint 2010:
This prevents me from doing any "normal" practical coding.
The general consesnus without using code-behind files is to use web-parts.
http://blogs.msdn.com/b/infopath/archive/2010/06/03/how-to-pass-querystring-data-into-an-infopath-form.aspx
But this is assuming you have control over your web parts. When my users go straight to the SharePoint list and attempt to add an item, I want to include a URL parameter. When coming straight from the list, I won't have any web parts on the page. So I can't use this method either. (It's seems like a frankenstein kludge to do that, anyway)
Is there any OTHER method for simply grabbing a parameter out of a URL query string? It seems like a very straight-forward task that is unnecessarily and impractically difficult to do, like MS decided to gimp themselves. I'm sure there's a reason, but I have no clue what that reason would be.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论