简体   繁体   English

如何将查询参数从SharePoint 2013页面发送到自动托管的应用程序中的SharePoint App Web部件?

[英]How can I send query parameters from SharePoint 2013 page to SharePoint App Web Part in autohosted app?

As the title suggests, I have an AutoHosted SharePoint 2013 application. 顾名思义,我有一个AutoHosted SharePoint 2013应用程序。 I have built a Web Part that can be added to a SharePoint page. 我已经构建了一个可以添加到SharePoint页面的Web部件。

I want to be able to pass query parameters from the parent page to my sharepoint web part app. 我希望能够将查询参数从父页面传递到我的sharepoint Web部件应用程序。 I just can't seem to figure out how to listen for query parameters from my web part. 我似乎无法弄清楚如何从Web部件中侦听查询参数。

What I am trying to do: mycompany.sharepoint.com/sites/mypage.aspx?variable=ContentIWant 我正在尝试做的事情:mycompany.sharepoint.com/sites/mypage.aspx?variable=ContentIWant

I have a WebPart added to 'mypage.aspx' and I can't seem to be able to get the content from the 'variable'. 我有一个WebPart添加到“ mypage.aspx”中,但似乎无法从“变量”中获取内容。

In C# on my app, I am outputting the following, but it does not output get parameters from the parent page. 在我的应用程序上的C#中,我正在输出以下内容,但它不会从父页面中输出get参数。

foreach(string key in Request.Form.Keys ) {
     Response.Write ( Request.Form[key] );   
}

foreach(string key in Request.QueryString.Keys ) {
     Response.Write ( Request.QueryString[key] );
}

As you can see I am doing both POST and GET variables in the hope of finding something useful. 如您所见,我正在同时执行POST和GET变量,以期找到有用的东西。

Has anyone ever tried to do what I am doing, and if so? 有没有人尝试做我正在做的事情,如果这样做? Any advice or code samples? 有任何建议或代码示例吗?

I have kind of the same problem. 我有同样的问题。

You can see my current "hacky" javascript solution here: Use Sharepoint querystring value as App-part property 您可以在此处查看我当前的“ hacky” javascript解决方案: 使用Sharepoint querystring值作为App-part属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 sharepoint自动托管的应用程序方面 - sharepoint autohosted app aspects SharePoint 2013 App Part如何在其父宿主网站中启动重定向? - How can a SharePoint 2013 App Part initiate a redirect in its parent host web? 使用Office 365制作应用程序部件在SharePoint 2013的主页上 - making an App Part On the main page of SharePoint 2013 using Office 365 如何从处理此事件的方法中将单击按钮的ID检索到SharePoint 2013 Web部件中? - How can I retrieve the ID of the clicked button from the method handling this event into a SharePoint 2013 Web Part? SharePoint 2013内容搜索查询Web部件,具有列表中的值 - SharePoint 2013 content search query web part with value from list 发布打包为SharePoint Online门户的自动托管应用程序的Office应用程序 - Publish an app for Office that is packaged as an autohosted app for SharePoint Online Portal Web部件页SharePoint 2013中的iframe - Iframe in web part page SharePoint 2013 SharePoint 2013-如何在内容查询Web部件中屏蔽URL - SharePoint 2013 - How to mask a url within a content query web part 简单的自动托管 SharePoint 应用程序永远不会触发远程事件接收器 - Simple autohosted SharePoint app is never firing the remote event receiver 从SharePoint Store + SharePoint 2013添加应用 - Adding App from SharePoint Store + SharePoint 2013
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM