[英]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.