在SharePoint2010可见Web部件中使用Web Service获得所有列表
来源:互联网 发布:南京图书销售软件 编辑:程序博客网 时间:2024/06/06 07:48
Get all lists using Web Service in SharePoint 2010 Visual Web Part
本文中,你将看到如何使用Web Service(_vti_bin/lists.asmx)获得所有列表,以及在SharePoint 2010 Visual Web部件中显示列表标题和描述。
Create an Empty SharePoint Project using Visual Studio 2010
1. 以管理员身份打开VS2010。
2. 新建项目。
3. 选择空白SharePoint项目。
4. 输入GetList作为项目名,点击确定。
5. 选择调试的本地站点,部署为场解决方案。
6. 点击完成。
Add Visual Web Part to the Empty SharePoint Project
1. 在解决方案管理其中,右击解决方案,点击添加。
2. 点击新项目。
3. 选择Visual Web部件。
4. 输入GetList作为Web部件名,点击添加。
Add Web Reference to the solution
1. 右击“引用”文件夹,点击“添加服务引用”。
2. 点击“高级”按钮。
3. 点击“添加Web引用”。
4. 在URL部分,输入lists web service URL并按下回车键。
5. 输入Web Reference名称,点击“添加引用”按钮。
6. Web Reference成功被添加。
GetListUserControl.ascx
1. 用以下代码代替GetListUserControl.aspx:
GetListUserControl.ascx.cs
1. 添加下列命名空间:
2. 用一下代码代替GetListUserControl.ascx.cs:
Deploy the solution:
1. 生成解决方案。
2. 按下F5。
Create SharePoint 2010 Visual Web Part in the SharePoint site:
1. 打开SharePoint站点。
2. 进入网站操作--编辑页面。
3. 编辑工具--插入--Web部件。
4. 在类别Custom选择GetList。
5. 点击添加。
6. Visual Web部件显示了所有列表标题和描述如下:
Summary:
到这里你已经看到了如何使用Web Service(_vti_bin/lists.asmx)获得所有列表,并在SharePoint 2010 Visual Web部件中显示所有列表标题和描述。
原文链接:
http://www.c-sharpcorner.com/UploadFile/anavijai/get-all-lists-using-web-service-in-sharepoint-2010-visual-we/
本机截图:
故障分析:
原文在Web Service引用方面出现问题,导致本机不能导入Web部件,或者出现应用程序错误等。
我将Web Service引用的地址改写为(本机为例):http://本机IP/_vti_bin/Lists.asmx。(请用你自己的IP替换掉例子中的本机IP)。相应的代码中对Web Service的引用也要进行替换。
0 0
- 在SharePoint2010可见Web部件中使用Web Service获得所有列表
- sharepoint2010 构建web部件
- Sharepoint2010 系列:在Infopath 2010中调用Web Service(SharePoint Server 2010 -“User Profile Service We)
- 在 web project 中的 jsp 程序中 使用 Web Service
- 演练:在 Visual Web Developer 中创建 Web 部件页
- 使用 Web service 的站点列表
- 使用 Web service 的站点列表
- 使用 Web service 的站点列表
- 使用 Web service 的站点列表
- 使用 Web service 的站点列表
- 使用 Web service 的站点列表
- 在SharePoint2010中创建列表出错
- web service不是所有
- 使用Visual Studio在标准Web Part 部件中创建事件处理器
- 演练:在 Visual Web Developer 中创建和使用 ASP.NET Web 服务------Web Service
- MyEclipse中使用Web Service
- 在 .NET 中使用 WEB SERVICE 的CallBacks机制 (1)
- 在 .NET 中使用 WEB SERVICE 的CallBacks机制 (2)
- ListActivity & ExpandableListActivity
- 第十三周上机实践项目——点、圆的关系
- HW的最后一轮面试
- Mac OS X 10.9 XCode5.1 Run Crash运行就崩溃,试试用5.1.1
- STM32串口IAP实验
- 在SharePoint2010可见Web部件中使用Web Service获得所有列表
- iOS_study_first
- 使用BitmapData实现图像的高速处理
- 加壳学习笔记(二)-汇编基础
- struts1.2 + spring2.5 + hibernate3.2框架搭建一之工程总览
- iOS_study_second
- HTTP协议学习总结(转载部分)
- ACE学习
- 关于网站备案