TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
savan patel
NA
14
3.4k
Get users of current sitecollection from User Information Li
Apr 16 2015 2:59 AM
I have "User Information List" and i want to get user of current site collection only but it is fetching all users of Farm.
Below is the code.
SPSite currentSite = SPContext.Current.Site; SPWeb web =currentSite.OpenWeb();
SPUserCollection userCollection = web.SiteUsers;
SPList userList = web.Lists.TryGetList("User Information List");
if (userList != null)
{
foreach (SPListItem item in userList.Items)
{
}
}
Not sure what i am doing wrong ! Any thoughts on this ??
Reply
Answers (
1
)
SharePoint WebPart Custom Properties: Password Field as Prop
Programmatically Add the Site Collections to Have Read Only