Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Can';t在使用“添加用户”之后,在PeopleEditor中以编程方式添加用户帐户;浏览对话框";_C#_Sharepoint - Fatal编程技术网

C# Can';t在使用“添加用户”之后,在PeopleEditor中以编程方式添加用户帐户;浏览对话框";

C# Can';t在使用“添加用户”之后,在PeopleEditor中以编程方式添加用户帐户;浏览对话框";,c#,sharepoint,C#,Sharepoint,我有一个带有SharePoint PeopleEditor的简单页面: PickerPage.aspx中的代码: <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server"> <table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%"> <wssuc:Inpu

我有一个带有SharePoint PeopleEditor的简单页面: PickerPage.aspx中的代码:

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
<wssuc:InputFormSection Title="People Editor" runat="server">
<Template_InputFormControls>
<wssuc:InputFormControl LabelText="Select Users:" runat="server">
<Template_Control>
<SharePoint:PeopleEditor AllowEmpty="true" ValidatorEnabled="true" ID="RespondentPeopleEditor" runat="server" MultiSelect="true" Width="280"
DialogHeight="400" DialogWidth="500" DialogTitle="Choose"
ShowCreateButtonInActiveDirectoryAccountCreationMode="true" SelectionSet="User" />
</Template_Control>
</wssuc:InputFormControl>
</Template_InputFormControls>
</wssuc:InputFormSection>
</table>
<asp:Button runat="server" ID="AddBtn" Text="Add User1" OnClick="AddBtn_Click" UseSubmitBehavior="false" />
</asp:Content>
当我加载我的页面并单击“添加User1”按钮时,User1已成功添加到PeopleEditor。但当我加载页面并使用默认对话框(浏览)在PeopleEditor中添加User2,然后单击按钮添加第二个用户(User1)时,User2仍保留在PeopleEditor中,但User1未添加到PeopleEditor中。
如何在使用standart添加对话框后以编程方式在PeopleEditor中添加用户?

当我尝试在代码“RespondentPeopleEditor.CommaSeparatedAccounts=accs”后克隆PeopleEditor控件时,新控件会同时拥有两个用户帐户。而在我的控件中,不知何故,新帐户不会添加到此.HiddenSpanData.Value中
public partial class PickerPage2 : LayoutsPageBase
{
    protected PeopleEditor RespondentPeopleEditor;
    protected Label ResultLbl;
    protected Button AddBtn;

    protected void Page_Load(object sender, EventArgs e)
    {}
    protected void AddBtn_Click(object sender, EventArgs e)
    {
        string accs = RespondentPeopleEditor.CommaSeparatedAccounts;
        if (!String.IsNullOrEmpty(accs)) accs += ",";
        accs += "domain\\user1";
        RespondentPeopleEditor.CommaSeparatedAccounts = accs;

    }
}