GetSectionMemberships(UserID) returning nothing

rated by 0 users
This post has 3 Replies | 2 Followers

Top 500 Contributor
Posts 55
Points 850
PKnopf Posted: Mon, May 5 2008 8:16 AM

 

Dim

sm As Generic.List(Of SectionMembership) = CommunityServer.Components.SectionMemberships.GetSectionMemberships(CommunityServer.Components.CSContext.Current.UserID, False)

This does not return anything. Anbody know why? The UserID im using is active in many sections.

  • | Post Points: 20
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Mon, May 5 2008 9:01 AM

 

Dim

sm As Generic.List(Of SectionMembership) = CommonDataProvider.Instance().GetSectionMembership(userID)

works though, why is that?

  • | Post Points: 5
Top 10 Contributor
Posts 3,424
Points 65,735
CS Developers

CSContext.Current.UserID represents the ID of the user identified on the querystring, not the *current* user.

The current user's ID should be accessed using CSContext.Current.User.UserID.

Ben Tiedt's Blog

  • | Post Points: 20
Top 500 Contributor
Posts 55
Points 850
PKnopf replied on Wed, May 7 2008 2:23 PM

 ahhh. thanks for that!

  • | Post Points: 5
Page 1 of 1 (4 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com