使用Visual Studio 创建可视Web Part部件

可视Web Part部件是很强大的Web 部件。它提供内置设计器创建你的用户界面。

本文主要解说怎样使用Visual Studio 创建可视Web Part部件.

准备,创建一个自己定义列表Stats,加入某些栏目,填充部分数据。

当中。栏目的数据类型为:

1. 打开Visual Studio,新建空白SharePoint项目SmallvilleVisualWPProject。

选择部署为场解决方式。

2. 右击项目加入新项--可视Web部件PlayerStats。
3. 右击项目加入一个新类PlayerStat。

点击确定。改动代码:

4. 此时文件结构应该是这种:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY3Jhenlnb2xm/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

5. 右击PlayerStatsUserControl.ascx。选择查看代码。
6. 在工具箱拖曳对应控件,最后代码例如以下:

7. 设计界面应该是这种:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY3Jhenlnb2xm/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

8. 双击每一个button以创建事件。
9. 双击PlayerStatsUserControl.ascx.cs来查看背后的代码。
10. 加入相应事件的代码。

最后代码应该是这种:

11.点击生成--部署解决方式。

12. 在SharePoint站点。点击站点操作--编辑页面--加入Web部件。
13. 在Custom类选中PlayerStats,点击加入。
14. 保存后,界面应该是这种:

点击Load后,载入了列表信息。

输入对应数据。点击Add,再点击Load。

点击Clear,全部填写的文本清空。

使用Visual Studio 创建可视Web Part部件的更多相关文章

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

    使用Visual Studio创建简单的自己定义Web Part 部件属性 自己定义属性使用额外的选项和设置拓展你的Web part部件.本文主要解说怎样使用Visual Studio创建简单的自己定 ...

  2. 使用Visual Studio 创建新的Web Part项目

    使用Visual Studio 创建新的Web Part项目 Web Part是你将为SharePoint创建的最常见的对象之中的一个.它是平台构建的核心基块. 1. 管理员身份打开Visual St ...

  3. 使用Visual Studio创建映像向导(Image Sprite)——Web Essential

    原版的:Creating Image Sprite in Visual Studio - Web Essential 译者注:有关图片精灵的信息请參阅http://baike.baidu.com/vi ...

  4. 使用Visual Studio创建图片精灵(Image Sprite)——Web Essential

    原文:Creating Image Sprite in Visual Studio - Web Essential 译者注:有关图片精灵的信息请参阅http://baike.baidu.com/vie ...

  5. 【翻译】使用Visual Studio创建Asp.Net Core MVC (一)

    This tutorial will teach you the basics of building an ASP.NET Core MVC web app using Visual Studio ...

  6. 用Visual Studio创建集成了gtest的命令行工程

    gtest代码库中的sample代码 在gtest的代码库中,包含了10个sample的代码,覆盖了gtest的常见用法,sample的代码位于以下文件夹: gtest\samples 由于gtest ...

  7. Visual studio 创建项目失败vstemplate

    Visual studio 创建项目失败 提示 the vstemplate file references the wizard class 'Microsoft.VisualStudio.WinR ...

  8. Xamarin 中Visual Studio创建项目提示错误

    Xamarin 中Visual Studio创建项目提示错误 错误信息:Object reference not set to an instance of an object 出现这种情况,是由于没 ...

  9. Visual studio 创建文件时自动添加备注

    Visual studio 创建文件时自动添加备注 描述 要求每回添加一个类,普通类或单元测试类文件头自动添加备注, 比如:Copyright, FileName, Author and so on. ...

随机推荐

  1. Servlet的学习之Session(1)

    在学习完了Servlet中的Cookie技术后,我们再来学习另一个能保存会话数据的技术——Session. Session是服务器端技术,利用这个技术,服务器在运行时可以为每一个用户的浏览器创建一个其 ...

  2. 几个前端博客 good

    http://www.cnblogs.com/JustinYoung/archive/2011/02/24/fresh-free-html-templates-2010.html http://www ...

  3. NYOJ 623 A*B ProblemII

    A*B Problem II 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描写叙述 ACM的C++同学有好多作业要做,最头痛莫过于线性代数了.由于每次做到矩阵相乘的时候,大 ...

  4. 控制台程序的参数解析类库 CommandLine

    C#控制台程序的参数解析类库 CommandLine简单使用说明 前言 C#开发的控制台程序,默认接收string[] args参数.如果有多个参数需要输入时,可以按照顺序依次输入:但如果有些参数不是 ...

  5. UVA11090 Going in Cycle!! (二分+SPFA推断有无负权)

    Problem G: Going in Cycle!! Input: standard input Output: standard output You are given a weighted d ...

  6. 使用GDI+绘制的360风格按钮控件(使用CN_DRAWITEM消息重绘,并使用TGPGraphics,TGPPen,TGPImage,TGPBitmap等)good

    将下面的代码拷贝到一个单元中,创建一个包,加入这个单元后安装.使用的时候设置好背景颜色,边框颜色,图标(png格式)相对路径的文件名称.这个控件可以利用PNG图像的颜色透明特性,背景色默认透明度为50 ...

  7. Delphi使用StrToDatetime在不同操作系统出现不同的情况(控制面板的时间格式都记录在注册表里,因此也可修改注册表)

    Str:=  '2010-4-13  06:22:22'; StrToDateTime(Str); 现象:在WinXP, Win2003 都不会报错 但是在Windows7,Windows Serve ...

  8. How a C++ compiler implements exception handling

    Introduction One of the revolutionary features of C++ over traditional languages is its support for ...

  9. ORACLE 中的一些特殊符号

    oracle通配符,运算符的使用 用于where比较条件的有: 等于:=.<.<=.>.>=.<> 包含:in.not in exists.not exists 范 ...

  10. CSS——inline-block属性

    Inline-block 是元素 display属性的一个值 .这个名字的由来是因为,可以简单的解释为inline+block :display设置这个值的元素,兼具行内元素( inline elem ...