Oracle VM VirtualBox上安装windows server2008R2做SharePointServer2010开发(下

简介:

这次我们来实际开发一个webpart的Demo添加到网站的页面上去

打开vs2010,新建project 

 注意在选择部署Debug的位置时要选择一个网站,当然也可以是根站点,这里选择的是Video站点 

 我们将默认的webpart删除,重新添加一个新的命名为WebPartButton 

 

 打开设计页面,添加一个按钮控件,双击后编写事件 

 

protected void Button1_Click(object sender, EventArgs e) 
        { 
            Response.Write("Hello,WebPart!!"); 
        }

然后可以启动Debug 

 打开网站进行在线调试,选择编辑网页,以添加webpart 

 

 添加webpart时,注意断则custom,是你自定义添加的webpart 

 添加完成之后,点击一下看看效果 

 到此时,调试已经可以正常开发了,但是怎么部署呢?

如果你是默认安装的话,本机的Sharepoint根站点有个目录在

C:\inetpub\wwwroot\wss\VirtualDirectories\80

我们先把webpart开发生成的dll文件拷贝到上面这个目录的Bin文件夹内

然后使用Reflector分析一下这个DLL,取得命名空间和DLL的信息 

 打开web.config添加节点

<SafeControl Assembly="WebPart1Demo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a1d39da85a11e887" Namespace="WebPart1Demo.WebPartButton" TypeName="*" Safe="True" />    
</SafeControls>

在编辑网页中,即可上传webpart!

 


     本文转自wengyuli 51CTO博客,原文链接:http://blog.51cto.com/wengyuli/586504,如需转载请自行联系原作者




相关文章
|
17天前
|
iOS开发 MacOS Windows
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
Mac air使用Boot Camp安装win10 ,拷贝 Windows 文件时出错
|
8天前
|
存储 JavaScript 前端开发
Node 版本控制工具 NVM 的安装和使用(Windows)
本文介绍了NVM(Node Version Manager)的Windows版本——NVM for Windows的安装和使用方法,包括如何安装Node.js的特定版本、列出已安装版本、切换使用不同版本的Node.js,以及其他常用命令,以实现在Windows系统上对Node.js版本的便捷管理。
Node 版本控制工具 NVM 的安装和使用(Windows)
9-14|npm install --global windows-build-tools 安装太慢了,能够指定国内源
9-14|npm install --global windows-build-tools 安装太慢了,能够指定国内源
|
24天前
|
SQL JavaScript 数据库
sqlite在Windows环境下安装、使用、node.js连接
sqlite在Windows环境下安装、使用、node.js连接
|
1月前
|
Ubuntu Oracle 关系型数据库
Oracle VM VirtualBox之Ubuntu 22.04LTS双网卡网络模式配置
这篇文章是关于如何在Oracle VM VirtualBox中配置Ubuntu 22.04LTS虚拟机双网卡网络模式的详细指南,包括VirtualBox网络概述、双网卡网络模式的配置步骤以及Ubuntu系统网络配置。
50 3
|
1月前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
2月前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
2月前
|
开发框架 .NET API
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
86 0
|
2月前
|
Linux Docker Windows
Windows——Docker拉取Windows Server镜像
Windows——Docker拉取Windows Server镜像
111 0

热门文章

最新文章

推荐镜像

更多
下一篇
无影云桌面