0
我在我的Newform.aspx中有一個PeoplePicker字段,我想在該域中選擇該域的用戶名並在另一個字段中更新。sharepoint新窗體獲取域用戶名從人選擇器
我認爲有一些問題,而使用如下:
strUser = properties.AfterProperties["PeoplePicker"].ToString();
web.AllowUnsafeUpdates = true;
SPUser spUser = web.EnsureUser(strUser);
spUser = spUser.LoginName; \\This returns Domain\Username
if (properties.AfterProperties["PeoplePicker"] != null)
{
properties.AfterProperties["AnotherField"] = spUser;
}
你能提供更多信息嗎? spUser prolly是typeof字符串,AnotherField屬性呢?任何調試信息? – YvesR 2011-06-08 07:16:07
@YvesR當我從單行文本中獲取信息時,它在AnotherField中更新正常,但不會從peoplePicker..i認爲在從PeoplePicker獲取數據後,我必須轉換爲其他格式 – jam 2011-06-08 07:31:27