New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

RadAvatar control is typically used to display images, icons or initials representing people or other entities.

For more information about the RadAvatar refer to the documentation and its API.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[ToolboxBitmap(typeof(RadAvatar), "Toolbox.Icons.Avatar.png")]
[RequiredScript(typeof(jQueryPlugins))]
[RequiredScript(typeof(Html5Avatar))]
[ClientScriptResource("Telerik.Web.UI.RadAvatar", "Telerik.Web.UI.Avatar.Scripts.RadAvatar.js")]
[EmbeddedSkin("Avatar", typeof(RadAvatar))]
[EmbeddedSkin("Avatar", "Default", typeof(RadAvatar))]
public class RadAvatar : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl

Inheritance: objectControlWebControlRadWebControlRadAvatar

Implements: IAttributeAccessorIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorIParserAccessorIPostBackDataHandlerIScriptControlISkinnableControlIUrlResolutionService...

Inherited Members WebControl.AddAttributesToRender(HtmlTextWriter)WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.LoadViewState(object)WebControl.TrackViewState()WebControl.MergeStyle(Style)WebControl.Render(HtmlTextWriter)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.RenderContents(HtmlTextWriter)WebControl.SaveViewState()WebControl.AccessKeyWebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.CssClassWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.HeightWebControl.IsEnabledWebControl.SupportsDisabledAttributeWebControl.SkinIDWebControl.TabIndexWebControl.TagNameWebControl.ToolTipWebControl.WidthControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.OnInit(EventArgs)Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.OnLoad(EventArgs)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.CreateChildControls()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadAvatar()

Properties

A text description of the Avatar image. When the Telerik.Web.UI.RadAvatar.Type is set to image, this value will be used to populate the alt attribute of the image element.

C#
public string Alt { get; set; }

Specifies whether the avatar should render border around its container element. Default is false.

C#
public bool Border { get; set; }

Adds additional custom classes to the Avatar container element.

C#
public string ClassName { get; set; }

The CssClass property will now be used instead of the former Skin and will be modified in AddAttributesToRender()

C#
protected override string CssClassFormatString { get; }

Overrides: RadWebControl.CssClassFormatString

Example:
C#
protected override string CssClassFormatString
{
       get
       {
           return "RadDock RadDock_{0} rdWTitle rdWFooter";
       }
}

Specifies the appearance fill style of the Avatar. The available values are "outline", "solid" (default), and "none".

C#
public AvatarFillMode FillMode { get; set; }

Specifies an icon name to be used if the avatar type is set to icon. For a list of available icon names, please refer to the Web Font Icons article.

C#
public string Icon { get; set; }

Specifies an image URL or dataURL that would be used to populate the src attribute of the avatar image element.

C#
public string Image { get; set; }

Could be one of the predefined shapes available for the widget container: "Full" (default), "Small", "Medium", "Large", or "None".

C#
public AvatarRounded Rounded { get; set; }

The Avatar allows you to set predefined sizes. The available size values are "Small", "Medium" (default), "Large", or "None".

C#
public AvatarSize Size { get; set; }
C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

Will be used to populated Avatar content when its type is set to text

C#
public string Text { get; set; }

The Avatar allows you to specify predefined theme colors for background of its container. The available themeColor values are: - "primary" (Default) - Applies coloring based on primary theme color. - "base" - Applies base theme color. - "secondary" - Applies coloring based on secondary theme color. - "tertiary" - Applies coloring based on tertiary theme color. - "inherit" - Applies inherited coloring value. - "info" - Applies coloring based on info theme color. - "success" - Applies coloring based on success theme color. - "warning" - Applies coloring based on warning theme color. - "error" - Applies coloring based on error theme color. - "dark" - Applies coloring based on dark theme color. - "light" - Applies coloring based on light theme color. - "inverse" - Applies coloring based on inverted theme color. - "none" - Does not apply theme color class.

C#
public AvatarThemeColor ThemeColor { get; set; }

Could be one of the three predefined types for the widget: icon, image, or text (default).

C#
public AvatarType Type { get; set; }

Methods

C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeComponent(IScriptDescriptor)

C#
protected override void OnPreRender(EventArgs e)
Parameters:eEventArgs

Overrides: RadWebControl.OnPreRender(EventArgs)

C#
public override void RenderClientStateField(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.RenderClientStateField(HtmlTextWriter)