Show random user in webpart
Hi
I'm developing a team site for soccer team. I would like to show a random player (member of the players group) in a webpart on the startpage. Anyone with a sample how to handle this.
Regards
Peter
Hi
I'm developing a team site for soccer team. I would like to show a random player (member of the players group) in a webpart on the startpage. Anyone with a sample how to handle this.
Regards
Peter
Are the "players" users in the site, or is this just a list of players?
If it's a list, I suggest the following psuedo code:
I assume you know how to write a webpart. If not, I suggest you read about this http://blogs.tamtam.nl/mart/CreateASharePoint2007WebpartStepByStep.aspx
Thanx
They are users in the site, do you know if it possible to handle that instead?
Otherwise thanks for the sample
Peter,
In my blog (link below) you will find (search for "common coding tasks") how to connect to the SPWeb object using code.
After doing that, you have access (using the .Users property of the SPWeb object) to the list of users that:
You can then implement the same logic I mentioned earlier with randomly selecting one of them (use the SPUser object to get to their properties as are tracked in the site)