Sharepoint 2010 Web 部件中的 Ajax 更新
有没有简单的方法可以在 Web 部件中进行 Ajax 调用?
我有一个带有按钮的 Web 部件,我希望当用户按下按钮时,它会执行服务器功能而不重新加载页面。然后,如果一切正常,则执行回调函数。我认为最好的方法是使用 AJAX 调用。
但是当我寻找如何做到这一点时,我只得到了一些我不太理解的复杂教程(大多数来自旧版本的 Sharepoint)。有什么帮助吗?最好的开始方式是什么?谢谢
Is there any easy way to make a Ajax call in a Webpart?
I have a Webpart with a button, and I want that when the user pushes the button, it executes a server function without reloading the page. And then, if all is ok, execute a callback function. I thought that the best way is with a AJAX call.
But when I've looked for how to do it I only get some complicated tutorials that I don't really understand (and most are from old versions of Sharepoint). Any help? What is the best way to start? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过将 jQuery 与内容编辑器 Web 部件一起使用?我以前做过这个,而且相当简单。这是我如何做到这一点的一步一步。
这是默认的工作方式。
Have you tried using jQuery with a content editor web part? I've done this before and it's rather easy. Here is a step by step for how I do it.
Here is a default way something should work.
如果可能的话,我会选择 Visual Studio 中的 Visual Web Part。您基本上创建了一个 .NET 用户控件。它为您节省了大量的手动控件定义等工作。
如果在 SharePoint2007 中,您可能想看看“Smartpart”。它有 ajax 支持和一些关于如何使用它的很棒的教程。
If possible I would go for a Visual Web Part in Visual Studio. You basically create a .NET user control. It saves you a lot of manual control definitions etc.
If in SharePoint2007 you might want to take a look at the "Smartpart". It has ajax support and some great tutorials on how to use it.