更改选择后面的代码集对SharePoint PeopleEditor进行控制

时间:2011-12-27 15:59:56

标签: c# sharepoint sharepoint-2010

我必须根据下拉列表的选择在代码隐藏上更改PeopleEditor的SelectionSet。发生的事情是,当它从用户更改为SPGroup后,当我点击“浏览”时我可以毫无问题地搜索共享点组,但是当我添加一个组并单击“检查名称”然后它没有解决它时,控件保持不变仅解析用户。

代码:

<SharePoint:PeopleEditor ID="peDestinatarios" runat="server" AfterCallbackClientScript="updateValidation('peDestinatarios');"
                                MultiSelect="true" SelectionSet="User" class="validate[funcCall[validateEmptyPicker]]" />

    protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlType.SelectedValue == "Users")
        {
            peDestinatarios.SelectionSet = "User";
        }
        else if (ddlType.SelectedValue == "Groups")
        {
            peDestinatarios.SelectionSet = "SPGroup";
        }

        peDestinatarios.CommaSeparatedAccounts = string.Empty;
    }

有什么想法吗?

提前致谢

1 个答案:

答案 0 :(得分:0)

这可能很愚蠢,但您的ddlType已设为AutoPostBack="true"