Welcome Guest, you are in: Namespace

A description of using the Sueetie UserAvatar Control

Sueetie UserAvatar Control

The Sueetie UserAvatar Control enables you to display a community member's avatar anywhere in your community. It support displaying the current Sueetie User or a user you specify through control properties. In its most simple usage, the Sueetie UserAvatar Control is as simple as the following HTML.

<SUEETIE:UserAvatar runat=server />

The above HTML displays the current user's thumbnail avatar image. Pretty simple.

UserAvatar Control Properties

The UserAvatar Control derives from the ASPNET ImageButton control and supports the following properties:

  • BorderWidth
  • Height
  • Width
  • CssClass
  • UseOriginalImage
  • PostBackToProfile
  • AvatarSueetieUser

The logic of determining the specific user's avatar to display is based on the AvatarSueetieUser SueetieUser object. The PostBackToProfile boolean property sets whether we want the image to link to the user's profile page. (Default: true.) The UseOriginalImage property says that we should use the user's larger image to generate the avatar. User Avatars are stored in two sizes, a larger size and thumbnail size, so if you want to display an avatar larger than the default thumbnail size (60x60), you'd use the larger image for better clarity. To learn more about how avatars are managed in Sueetie, please see the Sueetie User Avatars Wiki Document.

Defining AvatarSueetieUser: the UserAvatar In Action

We're going to use the Recent Forum Topic List View Control as an example of defining the AvatarSueetieUser for the Avatar Control display. Here is a screenshot of the topic list as displayed on the Sueetie.com Home Page.

Image

Now let's look at the View HTML which displays the individual Topic List View Item.

Image

You'll see how OnLoad() the AvatarSueetieUser is defined by retrieving a "ThinSueetieUser" from the SueetieForumTopic object's SueetieUserID property. It's important to note that we are not making a trip to the database to retrieve the avatar information, which is in reality a single integer. (More on Sueetie avatar logic in the Sueetie User Avatars Wiki Document.) This is where the ThinSueetieUser comes to play. A few essential properties of all registered community members are cached in server memory. It is from this cached user list that the UserAvatar control retrieves its avatar integer to create the /images/avatar/#t.jpg url.

ScrewTurn Wiki version 3.0.4.560.

Copyright © 2008-2012 Sueetie LLC. All rights reserved.
Sueetie