使用SharePoint 人员选择控件 在 WEB APP开发

首先 引用名字空间呗

<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

然后在页面上面添加

<wssawc:PeopleEditor
     AllowEmpty="false"
     ValidatorEnabled="true"
     id="userPicker"
     runat="server"
     ShowCreateButtonInActiveDirectoryAccountCreationMode="true"
     SelectionSet="User" />

进入后台页面

using Microsoft.SharePoint.WebControls;
public class MyPageName : Page
{
     protected PeopleEditor userPicker;
     …
}

 

最后通过

public void btnSave_Click(object sender, System.EventArgs e)
{
     ….
     PickerEntity pe = (PickerEntity)userPicker.Entities[0]; //gets first user in list
     string username = pe.Description;
     …
}

来获取 value

posted @   China2008  阅读(223)  评论(0编辑  收藏  举报
编辑推荐:
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· 一次Java后端服务间歇性响应慢的问题排查记录
· dotnet 源代码生成器分析器入门
阅读排行:
· ThreeJs-16智慧城市项目(重磅以及未来发展ai)
· .NET 原生驾驭 AI 新基建实战系列(一):向量数据库的应用与畅想
· Ai满嘴顺口溜,想考研?浪费我几个小时
· Browser-use 详细介绍&使用文档
· 软件产品开发中常见的10个问题及处理方法
历史上的今天:
2010-04-21 Sharepoint 列表 按月分组显示
点击右上角即可分享
微信分享提示