简体   繁体   English

Sharepoint Web部件POST

[英]Sharepoint web part POST

It's easy to create a hyperlink that passes parameters using GET by adding them to the URL: 通过将参数添加到URL来创建使用GET传递参数的超链接很容易:

http:\\somesite.com?name=fred http:\\ somesite.com?name = fred

but the web service I'm connecting to uses POST. 但是我要连接的Web服务使用POST。 What's the best way to do this in Sharepoint? 在Sharepoint中执行此操作的最佳方法是什么?

OK, I'm not surprised there's no answer to this. 好吧,我对此并不感到惊讶,这并不奇怪。 I suspect I'm probably approaching this in the wrong way and not explaining it well. 我怀疑我可能以错误的方式处理了这个问题,并且没有很好地解释它。

I want to take the user's browser to a diffent page passing POST data, like a HTML form would. 我想将用户的浏览器带到一个传递POST数据的不同页面,就像HTML表单一样。 But in sharepoint you can't change the 'action=' - you can only post back to the same page - if I understand the page life cycle bit correctly. 但是在sharepoint中,您不能更改'action ='-您只能发布回同一页面-如果我正确理解页面生命周期的话。

I'll try adding a button to the web part and use it's onclick() to do a HTTP web request. 我将尝试在Web部件中添加一个按钮,并使用它的onclick()进行HTTP Web请求。

If you need to post data differently, adding a second form element to the page should work. 如果您需要以其他方式发布数据,则应在页面上添加第二个表单元素。 It needs to be outside the SharePoint form, but adding another element outside that is easy enough with javascript/jQuery. 它必须在SharePoint表单之外,但是在javascript / jQuery之外添加另一个容易实现的元素。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM