문제

I have a site setup using Claims Based (Forms) authentication with Anonymous access enabled.

When a user logs into the site they may exist in the Forms Database, but not in the SharePoint Site collection. In this case SPContext.Current.Web.SPUser returns NULL - even though they are logged in.

Is there another object similar to SPUser that I can use?

도움이 되었습니까?

해결책

Is HttpContext.Current.User.Identity.IsAuthenticated == true? If so, try putting a call to SPContext.Current.Web.EnsureUser(HttpContext.Current.User.Identity.Name) before digging into Web.CurrentUser (which is what I presume you meant, not Web.SPUser)

-Oisin

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top