我必须根据下拉列表的选择在代码隐藏上更改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;
}
有什么想法吗?
提前致谢
答案 0 :(得分:0)
这可能很愚蠢,但您的ddlType已设为AutoPostBack="true"
?