使用Visual Studio创建简单的自己定义Web Part 部件属性

使用Visual Studio创建简单的自己定义Web Part 部件属性

自己定义属性使用额外的选项和设置拓展你的Web part部件。本文主要解说怎样使用Visual Studio创建简单的自己定义Web Part 部件属性。
1. 打开Visual Studio。点击文件--新建项目--空白SharePoint项目CustomWPProperties。部署为场解决方式。
2. 右击项目加入新项Web Part部件WPPropertyExample,点击加入。
3. 右击WPPropertyExample.cs,点击查看代码。

4. 加入代码。最后是这种:
5. 点击生成--部署解决方式。
6. 在SharePoint站点,点击站点操作--编辑页面--加入Web部件,在Custom类中选中WPPropertyExample,点击加入。
7. 编辑这个Web部件,在属性窗格能够看到:

posted @ 2016-04-07 11:12  lcchuguo  阅读(193)  评论(0编辑  收藏  举报