Sharepoint人员选择器没有显示 [英] Sharepoint people picker not displaying

查看:112
本文介绍了Sharepoint人员选择器没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误 - 控件不可用,因为您没有正确的权限

i在sharepoint中有自定义Web部件

它有人选择器

它只会在我登录我的用户帐户时工作

如果我从用户帐户退出,则显示以下错误



错误 - 由于您没有正确的权限,控件不可用

Error-The control is not available because you do not have the correct permissions
i have custom web part in sharepoint
It have people picker
it will only working when i sign in into my user account
if i sign out from user account, it show the following error

Error-The control is not available because you do not have the correct permissions

<SharePoint:PeopleEditor  runat="server" ID="txtuser" AllowEmpty="True" MultiSelect="False" PrincipalSource="Windows" SelectionSet="User" Width="300px" Height="20px" ErrorMessage="Select Valid User" ShowCreateButtonInActiveDirectoryAccountCreationMode="true"/>







PickerEntity mypicker = (PickerEntity)txtuser.Entities[0];
                           string username = mypicker.DisplayText;
                           SPUser users_applied = myweb.EnsureUser(username);
                           SPFieldUserValue fuv_applied = new SPFieldUserValue(myweb, users_applied.ID, users_applied.Name);

推荐答案

确保您已导入以下参考



Make sure you have imported following reference

<%@ Assembly Name="


SharePoint.Project.AssemblyFullName
SharePoint.Project.AssemblyFullName


%>
<%@ Assembly Name =Microsoft.Web.CommandUI,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c%>
<%@ Register TagPrefix =SharePointNamespace =Microsoft.SharePoint.WebControlsAssembly =Microsoft.SharePoint,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c%>
<%@ Register TagPrefix =UtilitiesNamespace =Microsoft.SharePoint.UtilitiesAssembly =Microsoft.SharePoint,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c%>
<%@ Register TagPrefix =aspNamespace =System.Web.UIAssembly =System.Web.Extensions,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35%>
<%@ Import Namespace =Microsoft.SharePoint%>
<%@ Register TagPrefix =WebPartPagesNamespace =Microsoft.SharePoint.WebPartPagesAssembly =Microsoft.SharePoint,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c%>
" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>








我用过它喜欢以下






I have used it like following

<SharePoint:PeopleEditor runat="server" ID="ppl1stApprover" IsValid="true" AllowEmpty="false"
                    MultiSelect="false" Width="300px" />











and

<pre lang="c#"><pre lang="c#">

person = (PickerEntity)ppl3rdApprover.ResolvedEntities[0];
                    thirdApprover = SPContext.Current.Web.EnsureUser(person.Key);


这篇关于Sharepoint人员选择器没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆