承接MOSS各种工作流开发 联系人:王先生.电话:18618405729QQ:252385878 QQ群:41696750 MSN:wanghao-3@hotmail.com

导航

使用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 on 2010-11-10 15:36  A A  阅读(643)  评论(0编辑  收藏  举报