We are excited to announce that the ASP.NET Forums are moving to the new Microsoft Q&A experience.
Learn more >
Community Starter Kit (RETIRED)
Setting current community ina multiple communities environment by cod...
Re: Setting current community ina multiple communities environment by...
View Complete Thread
Re: Setting current community ina multiple communities environment by code
Dec 15, 2003 10:21 AM
This is possible, but not quite simple. You would need to modify the CommunitiesModule class so that instead of looking at the URL, it looks at the user selected community. If the user hasn't selected a section yet, you would send the browser over to a new aspx page that you create that allows the user to pick a community. The real trick though is where and how to store the communityID that the user picked. Normally I would say you would store it in a Session variable. The problem is that with the current design of CommunitiesModule in the CSK, the app expects to determine the community, section, and user before ASP.NET has established the session identity for the user. So you'd basically have to take all of the stuff that happens in the BeginRequest and AuthenticateUser event handlers and move it to a new event handler that you would attach to the AcquireRequestState event. Either that or find a better way to make the user's community selection available to the CommunitiesModule during the BeginRequest event (maybe manually fetch it from a cookie, but again, I don't know if ASP.NET has setup enough of the internal objects by BeginRequest for you to do that.
Stephen M. Redd